/* Reset e base */
* {
    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-color: #f9f9f9;
    transition: background-color 0.3s, color 0.3s;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.dark {
    background-color: #222;
    color: #ddd;
}

/* Header */
#header {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 1000;
    padding: 10px 0;
}

body.dark #header {
    background-color: rgba(34, 34, 34, 0.95);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 50px;
}

.logo a {
    text-decoration: none;
}

.spotify-links {
    display: flex;
    gap: 10px;
}

.spotify-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    background-color: #1db954;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 14px;
}

.hamburger {
    display: block;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

/* Sidebar */
#sidebar {
    position: fixed;
    top: 70px;
    left: -250px;
    width: 250px;
    height: calc(100vh - 70px);
    background-color: #fff;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    transition: left 0.3s;
    z-index: 999;
    overflow-y: auto;
}

body.dark #sidebar {
    background-color: #333;
}

#sidebar.open {
    left: 0;
}

.nav-menu {
    list-style: none;
    padding: 20px;
}

.nav-link {
    display: block;
    padding: 10px 0;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #eee;
    transition: color 0.3s;
}

body.dark .nav-link {
    color: #ddd;
    border-bottom-color: #555;
}

.nav-link:hover {
    color: #1db954;
}

.nav-link.has-notes::after {
    content: " 📝";
}

/* Main */
#main {
    margin-top: 80px;
    padding: 20px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    flex: 1;
}

.progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.btn {
    padding: 8px 16px;
    background-color: #add8e6;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #87ceeb;
}

body.dark .btn {
    background-color: #333;
    color: white;
    border: 1px solid #666;
}

/* Intro */
.intro {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #f5f5dc 0%, #add8e6 100%);
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.intro h1 {
    font-size: 2.5em;
    color: #333;
    margin-bottom: 10px;
    font-family: 'Times New Roman', serif;
}

.intro blockquote {
    font-size: 1.2em;
    font-style: italic;
    color: #555;
    border-left: 5px solid #add8e6;
    padding-left: 15px;
    margin: 0;
}

/* Dia cards */
.dia-card {
    background: linear-gradient(135deg, #fff 0%, #f9f9f9 100%);
    margin-bottom: 30px;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}

.dia-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.dia-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #add8e6, #f5f5dc);
}

body.dark .dia-card {
    background: linear-gradient(135deg, #444 0%, #333 100%);
    color: #ddd;
}

.dia-card.even {
    background: linear-gradient(135deg, #f5f5dc 0%, #e6e6fa 100%);
}

body.dark .dia-card.even {
    background: linear-gradient(135deg, #555 0%, #666 100%);
}

.dia-card.odd {
    background: linear-gradient(135deg, #add8e6 0%, #b0e0e6 100%);
}

body.dark .dia-card.odd {
    background: linear-gradient(135deg, #666 0%, #777 100%);
}

.dia-card h2 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-align: center;
    color: #333;
}

body.dark .dia-card h2 {
    color: #ddd;
}

.dia-card h3 {
    font-size: 2em;
    margin-bottom: 20px;
    text-align: center;
    font-family: 'Times New Roman', serif;
    color: #555;
}

body.dark .dia-card h3 {
    color: #ccc;
}

.dia-card h4 {
    font-size: 1.3em;
    margin-top: 20px;
    margin-bottom: 10px;
    color: #444;
    border-bottom: 2px solid #add8e6;
    padding-bottom: 5px;
}

body.dark .dia-card h4 {
    color: #bbb;
    border-bottom-color: #777;
}

.dia-card blockquote {
    font-family: 'Times New Roman', serif;
    font-size: 1.1em;
    font-style: italic;
    border-left: 5px solid #f5f5dc;
    padding-left: 15px;
    margin: 15px 0;
    color: #333;
    background: rgba(245, 245, 220, 0.5);
    padding: 15px;
    border-radius: 5px;
}

body.dark .dia-card blockquote {
    color: #ddd;
    background: rgba(85, 85, 85, 0.5);
    border-left-color: #777;
}

.dia-card p {
    line-height: 1.7;
    margin-bottom: 15px;
}

.toggle-btn {
    background: linear-gradient(135deg, #333 0%, #555 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    margin-bottom: 20px;
    font-size: 1em;
    transition: background 0.3s, transform 0.2s;
}

.toggle-btn:hover {
    background: linear-gradient(135deg, #555 0%, #777 100%);
    transform: scale(1.05);
}

body.dark .toggle-btn {
    background: linear-gradient(135deg, #ddd 0%, #bbb 100%);
    color: #333;
}

.content {
    margin-bottom: 20px;
    display: block; /* Sempre visível por padrão */
    animation: fadeIn 0.5s ease-in;
}

.content.show {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.pdf-links {
    margin-bottom: 20px;
}

.pdf-links a {
    display: inline-block;
    margin-right: 15px;
    padding: 8px 15px;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s;
}

.pdf-links a:hover {
    background: #0056b3;
}

body.dark .pdf-links a {
    background: #0056b3;
}

body.dark .pdf-links a:hover {
    background: #003d82;
}

.notas {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    border: 1px solid #ddd;
}

body.dark .notas {
    background: rgba(68, 68, 68, 0.8);
    border-color: #777;
}

.notas label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    color: #333;
}

body.dark .notas label {
    color: #ddd;
}

.notas textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #add8e6;
    border-radius: 10px;
    resize: vertical;
    font-family: inherit;
    font-size: 1em;
    transition: border-color 0.3s;
}

.notas textarea:focus {
    outline: none;
    border-color: #87ceeb;
}

body.dark .notas textarea {
    background-color: #555;
    color: #ddd;
    border-color: #777;
}

.save-btn, .clear-btn {
    margin-top: 15px;
    margin-right: 15px;
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s;
}

.save-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.save-btn:hover {
    background: linear-gradient(135deg, #20c997 0%, #17a2b8 100%);
    transform: scale(1.05);
}

.clear-btn {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
    color: white;
}

.clear-btn:hover {
    background: linear-gradient(135deg, #fd7e14 0%, #ffc107 100%);
    transform: scale(1.05);
}

.save-msg {
    margin-top: 15px;
    color: #28a745;
    font-weight: bold;
    font-size: 0.9em;
}

/* Navigation buttons */
.navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.nav-btn {
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.nav-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Footer */
#footer {
    background-color: #333;
    color: white;
    padding: 20px 0;
    text-align: center;
}

#footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

#footer a {
    color: white;
    text-decoration: none;
}

#footer a:hover {
    text-decoration: underline;
}

.social-icons a {
    color: white;
    margin: 0 10px;
    font-size: 24px;
}

.localstorage-note {
    margin-top: 10px;
    font-size: 14px;
    color: #ccc;
}

/* Responsive */
@media (max-width: 767px) {
    .progress {
        flex-direction: column;
        gap: 10px;
    }

    .progress span {
        text-align: center;
        font-size: 18px;
    }

    .btn {
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
    }
}

@media (min-width: 768px) {
    #sidebar {
        left: 0;
        width: 200px;
    }

    #main {
        margin-left: 220px;
        margin-right: 20px;
    }

    .hamburger {
        display: none;
    }

    #footer .container {
        flex-direction: row;
    }
}

@media (min-width: 1024px) {
    #sidebar {
        width: 250px;
    }

    #main {
        margin-left: 270px;
        margin-right: 20px;
        width: calc(100vw - 290px);
        max-width: none;
    }
}

/* Print styles */
@media print {
    body {
        font-size: 12pt;
        line-height: 1.4;
        color: black;
        background: white !important;
    }

    #header, #sidebar, .hamburger, .progress, .navigation, .toggle-btn, .save-btn, .clear-btn, .save-msg, .localstorage-note, #footer {
        display: none !important;
    }

    #main {
        margin: 0;
        width: 100%;
        max-width: none;
    }

    .dia-card {
        page-break-before: always;
        margin: 0;
        padding: 20px;
        box-shadow: none;
        border: 1px solid #ccc;
        background: white !important;
    }

    .dia-card:first-child {
        page-break-before: avoid;
    }

    .notas {
        border-top: 1px solid #ccc;
        margin-top: 20px;
        padding-top: 20px;
    }

    .notas textarea {
        border: 1px solid #000;
        width: 100%;
        min-height: 100px;
    }

    h1, h2, h3, h4 {
        color: black !important;
    }

    blockquote {
        border-left: 3px solid #000;
        padding-left: 10px;
        font-style: italic;
    }
}

/* Hidden class */
.hidden {
    display: none !important;
}