* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    position: relative;
}

.watermark-bg {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10vw;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.05);
    z-index: 0;
    white-space: nowrap;
    pointer-events: none;
}
.app-container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(2px);
}

.nav-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
}

header {
    text-align: center;
    color: white;
    padding: 2rem 1rem;
}

.brand-logo-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.main-logo {
    width: 50px;
    height: 50px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.brand-name {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.brand-name span {
    color: #ffd700;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

.theory-container {
    flex: 1;
    padding: 2rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.search-wrapper {
    position: relative;
    margin-bottom: 2rem;
}

.search-wrapper i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 1.1rem;
}

.search-wrapper input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.search-wrapper input:focus {
    outline: none;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
}

.theory-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.option-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.option-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.option-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.option-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
}

.option-icon.practice {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.option-icon.exam {
    background: linear-gradient(135deg, #f093fb, #f5576c);
}

.option-card h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.option-card p {
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.theory-content {
    margin-top: 3rem;
}

.practice-grid {
    column-count: 3;
    column-gap: 1rem;
}

.practice-card.compact-card {
    break-inside: avoid;
    margin: 0 0 1rem;
    padding: 1rem;
    text-align: left;
    border-radius: 12px;
}

.option-card .practice-question-title {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    line-height: 1.35;
    color: #1d4ed8;
    font-weight: 700;
}

.practice-meta {
    margin: 0 0 0.75rem;
    font-size: 0.8rem;
    color: #475569;
}

.qa-block {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
}

.qa-question {
    margin: 0 0 0.45rem;
    font-size: 0.86rem;
    line-height: 1.35;
    color: #0f172a;
}

.qa-question-body {
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    line-height: 1.35;
    color: #1e293b;
}

.qa-answer {
    background: rgba(139, 92, 246, 0.10);
    border-left: 3px solid #8b5cf6;
    border-radius: 8px;
    padding: 0.6rem 0.7rem;
    white-space: pre-line;
    font-size: 0.8rem;
    line-height: 1.35;
    color: #1e293b;
}

.qa-question-body table,
.qa-answer table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.45rem;
    background: #ffffff;
    border: 1px solid #cbd5e1;
}

.qa-question-body th,
.qa-question-body td,
.qa-answer th,
.qa-answer td {
    border: 1px solid #cbd5e1;
    padding: 0.35rem 0.45rem;
    text-align: left;
    vertical-align: top;
    font-size: 0.75rem;
}

.qa-question-body th,
.qa-answer th {
    background: #eff6ff;
    color: #1e3a8a;
    font-weight: 700;
}

.theory-content h2 {
    font-size: 1.8rem;
    color: white;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.subject-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.subject-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.subject-card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.subject-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.subject-card p {
    font-size: 0.85rem;
    color: #999;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: white;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.empty-state p {
    font-size: 1.1rem;
    opacity: 0.8;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    transition: all 0.3s ease;
}

.modal-close:hover {
    color: #333;
}

.modal h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    color: #333;
}

.year-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.year-item {
    padding: 1rem;
    border: 2px solid #eee;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-weight: 600;
    color: #333;
}

.year-item:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

/* Responsive Design */
@media (max-width: 768px) {
    .top-nav {
        padding: 0.75rem 1rem;
    }

    header h1 {
        font-size: 1.8rem;
    }

    header p {
        font-size: 0.95rem;
    }

    .theory-container {
        padding: 1rem;
    }

    .theory-options {
        grid-template-columns: 1fr;
    }

    .subjects-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .brand-logo-box {
        flex-direction: column;
        gap: 0.5rem;
    }

    .brand-name {
        font-size: 1.4rem;
    }

    .practice-grid {
        column-count: 2;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }

    .option-card {
        padding: 1.5rem;
    }

    .subjects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .subject-card-icon {
        font-size: 2rem;
    }

    .subject-card h3 {
        font-size: 0.9rem;
    }

    .practice-grid {
        column-count: 1;
    }
}
