/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

/* Header Styles */
header {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.2em;
    opacity: 0.95;
}

/* Main Section Styles */
.main-section {
    padding: 40px;
    border-bottom: 3px solid #f0f0f0;
}

.main-section h2 {
    color: #764ba2;
    font-size: 2em;
    margin-bottom: 20px;
    border-left: 5px solid #f093fb;
    padding-left: 15px;
}

.content-box {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 8px;
    margin-top: 20px;
}

.content-box h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.5em;
}

/* Step Styles */
.step {
    background: white;
    padding: 20px;
    margin: 15px 0;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.step h4 {
    color: #764ba2;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.step ul, .step ol {
    margin-left: 20px;
    margin-top: 10px;
}

.step li {
    margin: 8px 0;
}

code {
    background: #e8e8e8;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: #c7254e;
}

/* Interface Grid */
.interface-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.interface-item {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid #667eea;
    transition: transform 0.3s, box-shadow 0.3s;
}

.interface-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.interface-item h4 {
    color: #764ba2;
    margin-bottom: 10px;
    font-size: 1.3em;
}

/* Data Source Table */
.data-source-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.data-source-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.data-source-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.data-source-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #ddd;
}

.data-source-table tbody tr:hover {
    background: #f5f5f5;
}

/* Examples Section */
.examples-section {
    padding: 40px;
    background: linear-gradient(to bottom, #f9f9f9 0%, #ffffff 100%);
}

.examples-section h2 {
    color: #764ba2;
    font-size: 2em;
    margin-bottom: 10px;
    text-align: center;
}

.examples-intro {
    text-align: center;
    font-size: 1.1em;
    color: #666;
    margin-bottom: 30px;
}

/* Example Card Styles */
.example-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin: 25px 0;
    overflow: hidden;
    border: 2px solid #e0e0e0;
    transition: box-shadow 0.3s;
}

.example-card:hover {
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.example-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.example-header h3 {
    font-size: 1.4em;
    margin: 0;
}

/* Difficulty Badges */
.difficulty {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: bold;
    text-transform: uppercase;
}

.difficulty.easy {
    background: #4caf50;
}

.difficulty.medium {
    background: #ff9800;
}

.difficulty.hard {
    background: #f44336;
}

/* Example Content */
.example-content {
    padding: 25px;
}

.example-content p {
    margin: 15px 0;
    font-size: 1.05em;
}

.example-content ul {
    margin: 15px 0 15px 20px;
}

.example-content li {
    margin: 8px 0;
}

.hint {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 12px;
    margin: 15px 0;
    border-radius: 4px;
    font-style: italic;
}

/* Toggle Button */
.toggle-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1em;
    border-radius: 25px;
    cursor: pointer;
    margin: 20px 0;
    transition: transform 0.2s, box-shadow 0.2s;
    font-weight: 600;
}

.toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.toggle-btn:active {
    transform: translateY(0);
}

/* Solution Box */
.solution {
    background: #e8f5e9;
    border: 2px solid #4caf50;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    animation: slideDown 0.4s ease-out;
}

.solution.hidden {
    display: none;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.solution h4 {
    color: #2e7d32;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.solution ul, .solution ol {
    margin: 15px 0 15px 20px;
}

.solution li {
    margin: 10px 0;
}

/* Code Example Box */
.code-example {
    background: #263238;
    color: #aed581;
    padding: 20px;
    border-radius: 6px;
    margin: 15px 0;
    overflow-x: auto;
}

.code-example p {
    color: #fff;
    margin-bottom: 10px;
}

.code-example pre {
    color: #aed581;
    font-family: 'Courier New', monospace;
    line-height: 1.5;
    margin: 0;
}

/* Data Example Table */
.data-example-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.data-example-table th {
    background: #667eea;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

.data-example-table td {
    padding: 10px 12px;
    border: 1px solid #ddd;
}

.data-example-table tr:nth-child(even) {
    background: #f9f9f9;
}

/* Comments Section - Using RGB(212, 61, 15) */
.comments-section {
    padding: 40px;
    background: linear-gradient(135deg, rgba(212, 61, 15, 0.05) 0%, rgba(212, 61, 15, 0.1) 100%);
    border-top: 5px solid rgb(212, 61, 15);
}

.comments-section h2 {
    color: rgb(212, 61, 15);
    font-size: 2em;
    margin-bottom: 30px;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(212, 61, 15, 0.2);
}

.comments-container {
    max-width: 1000px;
    margin: 0 auto;
}

/* Comment Form */
.comment-form {
    background: white;
    padding: 30px;
    border-radius: 10px;
    border: 3px solid rgb(212, 61, 15);
    box-shadow: 0 5px 15px rgba(212, 61, 15, 0.3);
    margin-bottom: 40px;
}

.comment-form h3 {
    color: rgb(212, 61, 15);
    margin-bottom: 20px;
    font-size: 1.5em;
}

.comment-input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 2px solid rgb(212, 61, 15);
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.comment-input:focus {
    outline: none;
    border-color: rgb(180, 50, 10);
    box-shadow: 0 0 8px rgba(212, 61, 15, 0.3);
}

.comment-textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 2px solid rgb(212, 61, 15);
    border-radius: 6px;
    font-size: 1em;
    min-height: 120px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    resize: vertical;
    transition: border-color 0.3s;
}

.comment-textarea:focus {
    outline: none;
    border-color: rgb(180, 50, 10);
    box-shadow: 0 0 8px rgba(212, 61, 15, 0.3);
}

.submit-comment-btn {
    background: rgb(212, 61, 15);
    color: white;
    border: none;
    padding: 12px 35px;
    font-size: 1.1em;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s, transform 0.2s;
}

.submit-comment-btn:hover {
    background: rgb(180, 50, 10);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 61, 15, 0.4);
}

.submit-comment-btn:active {
    transform: translateY(0);
}

/* Comments Display */
.comments-display {
    background: white;
    padding: 30px;
    border-radius: 10px;
    border: 3px solid rgb(212, 61, 15);
    box-shadow: 0 5px 15px rgba(212, 61, 15, 0.3);
}

.comments-display h3 {
    color: rgb(212, 61, 15);
    margin-bottom: 25px;
    font-size: 1.5em;
    border-bottom: 3px solid rgb(212, 61, 15);
    padding-bottom: 10px;
}

/* Comments Table */
.comments-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.comments-table thead {
    background: rgb(212, 61, 15);
    color: white;
}

.comments-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    border: 2px solid rgb(180, 50, 10);
}

.comments-table td {
    padding: 12px 15px;
    border: 2px solid rgba(212, 61, 15, 0.3);
    vertical-align: top;
}

.comments-table tbody tr {
    background: white;
    transition: background 0.3s;
}

.comments-table tbody tr:nth-child(even) {
    background: rgba(212, 61, 15, 0.05);
}

.comments-table tbody tr:hover {
    background: rgba(212, 61, 15, 0.15);
}

/* Delete Button */
.delete-btn {
    background: rgb(212, 61, 15);
    color: white;
    border: 2px solid rgb(180, 50, 10);
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: background 0.3s, transform 0.2s;
}

.delete-btn:hover {
    background: rgb(180, 50, 10);
    transform: scale(1.05);
}

.delete-btn:active {
    transform: scale(0.95);
}

/* Footer */
footer {
    background: #263238;
    color: white;
    padding: 30px;
    text-align: center;
}

footer p {
    margin: 5px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 1.8em;
    }

    .main-section {
        padding: 20px;
    }

    .example-header {
        flex-direction: column;
        gap: 10px;
    }

    .interface-grid {
        grid-template-columns: 1fr;
    }

    .comments-table {
        font-size: 0.9em;
    }

    .comments-table th,
    .comments-table td {
        padding: 8px;
    }
}

/* Animation for page load */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.container {
    animation: fadeIn 0.5s ease-in;
}