/* ===== RESET & GLOBAL ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', sans-serif;
}

body {
    background: #ffffff;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

/* CRITICAL FIX: Ensure all interactive elements can receive clicks */
a, button, input, select, .btn, .card, .soal-card {
    -webkit-tap-highlight-color: transparent;
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* ===== HEADER & NAV ===== */
header {
    background: #1a73e8;
    padding: 15px 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

header .logo {
    font-size: 1.8em;
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto !important;
}

nav ul {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
    flex-wrap: wrap;
}

nav ul li {
    list-style: none;
}

nav ul li a {
    color: #fff;
    font-size: 1.1em;
    padding: 8px 15px;
    border-radius: 5px;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    pointer-events: auto !important;
}

nav ul li a:hover,
nav ul li a.active {
    background: #174ea6;
}

/* ===== HERO & CONTAINER ===== */
.container {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.hero {
    background: #f0f7fa;
    padding: 40px 20px;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 30px;
}

.hero h1 { 
    font-size: 2.5em; 
    color: #1a73e8; 
    margin-bottom: 10px; 
}

.hero p { 
    font-size: 1.2em; 
    color: #555; 
}

/* ===== CARD GRID (HOME) ===== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    padding: 0 20px;
    margin-bottom: 30px;
}

.card {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    cursor: pointer !important;
    transition: all 0.3s;
    border: 1px solid #e0e0e0;
    pointer-events: auto !important;
    position: relative;
    z-index: 1;
}

.card * {
    pointer-events: none;
}

.card:hover {
    background: #e3f2fd;
    transform: translateY(-3px);
    border-color: #1a73e8;
}

.card h3 {
    color: #1a73e8;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.card h3 i { 
    color: #34c759; 
}

/* ===== BANK SOAL ===== */
.soal-container {
    padding: 20px;
}

.soal-section {
    margin-bottom: 40px;
}

.category-title {
    color: #1a73e8;
    font-size: 1.8em;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.year-group {
    margin-bottom: 30px;
}

.year-title {
    color: #555;
    font-size: 1.4em;
    margin-bottom: 15px;
    padding-left: 10px;
    border-left: 4px solid #1a73e8;
}

.soal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.soal-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    transition: all 0.3s;
    pointer-events: auto !important;
    position: relative;
    z-index: 1;
}

.soal-card:hover {
    transform: translateY(-5px);
    border-color: #1a73e8;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.soal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.soal-tahun {
    background: #1a73e8;
    color: #fff;
    padding: 4px 10px;
    border-radius: 15px;
    font-weight: 600;
    font-size: 0.85em;
}

.soal-tingkat {
    color: #34c759;
    font-weight: 600;
    font-size: 0.9em;
}

.soal-icon {
    text-align: center;
    margin: 15px 0;
}

.soal-icon i {
    font-size: 2.5em;
    color: #1a73e8;
}

.soal-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.soal-type {
    font-weight: 600;
    color: #1a73e8;
}

.soal-badge {
    background: #e3f2fd;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.85em;
}

.soal-actions {
    display: flex;
    justify-content: center;
}

.btn-download {
    background: #1a73e8;
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer !important;
    transition: all 0.3s;
    text-decoration: none;
    border: none;
    pointer-events: auto !important;
    position: relative;
    z-index: 10;
}

.btn-download:hover {
    background: #174ea6;
    transform: scale(1.05);
}

/* ===== MODAL PREVIEW ===== */
.modal {
    display: none;
    position: fixed;
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0;
    background: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 20px;
}

.modal-content {
    background: #fff;
    border-radius: 10px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-header {
    padding: 15px 20px;
    background: #1a73e8;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5em;
    cursor: pointer !important;
    pointer-events: auto !important;
}

.modal-body {
    padding: 20px;
    max-height: calc(90vh - 60px);
    overflow-y: auto;
}

#pdf-viewer {
    width: 100%;
    height: 70vh;
}

/* ===== KALKULATOR ===== */
.calculator {
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab {
    flex: 1;
    padding: 12px;
    background: #f0f7fa;
    color: #1a73e8;
    border-radius: 8px;
    text-align: center;
    cursor: pointer !important;
    font-weight: 600;
    transition: all 0.3s;
    border: 2px solid transparent;
    pointer-events: auto !important;
}

.tab.active {
    background: #1a73e8;
    color: #fff;
    border-color: #174ea6;
}

.tab:hover {
    background: #1a73e8;
    color: #fff;
}

.calc-display {
    width: 100%;
    padding: 15px;
    font-size: 1.8em;
    text-align: right;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    margin-bottom: 15px;
    background: #f8f9fa;
}

.btn-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.btn {
    padding: 15px;
    font-size: 1.1em;
    border: none;
    border-radius: 8px;
    cursor: pointer !important;
    transition: all 0.2s;
    user-select: none;
    pointer-events: auto !important;
    position: relative;
    z-index: 1;
}

.btn:active {
    transform: scale(0.95);
}

.btn:hover { 
    transform: scale(1.05); 
}

.btn-number, .btn-decimal { 
    background: #e0e0e0; 
}

.btn-number:hover, .btn-decimal:hover { 
    background: #b0b0b0; 
}

.btn-operator { 
    background: #1a73e8; 
    color: #fff; 
}

.btn-operator:hover { 
    background: #174ea6; 
}

.btn-clear { 
    background: #6b7280; 
    color: #fff; 
}

.btn-clear:hover { 
    background: #4b5563; 
}

.btn-equals { 
    background: #34c759; 
    color: #fff; 
}

.btn-equals:hover { 
    background: #2aa645; 
}

.btn-function {
    background: #ff9500;
    color: #fff;
}

.btn-function:hover {
    background: #e68600;
}

.error-message {
    color: #ff3b30;
    text-align: center;
    margin-top: 10px;
    font-weight: 600;
}

/* Matrix specific styles */
.matrix-input-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.matrix-group {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.matrix-size-input {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 10px 0;
}

.matrix-size-input input {
    width: 60px;
    padding: 5px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    text-align: center;
}

.matrix-grid {
    margin-top: 10px;
}

.matrix-row {
    display: flex;
    gap: 5px;
    margin-bottom: 5px;
}

.matrix-cell {
    flex: 1;
    padding: 8px;
    text-align: center;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 1em;
}

.matrix-operation-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.matrix-gap {
    height: 20px;
}

.matrix-result-section {
    background: #e3f2fd;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

/* ===== KONVERTER ===== */
.converter-wrapper {
    max-width: 900px;
    margin: 20px auto;
    padding: 20px;
}

.converter-card {
    background: #fff;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.converter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.converter-tab {
    padding: 10px 20px;
    background: #f0f7fa;
    color: #1a73e8;
    border-radius: 20px;
    cursor: pointer !important;
    font-weight: 600;
    transition: all 0.3s;
    border: 2px solid transparent;
    pointer-events: auto !important;
}

.converter-tab:hover {
    background: #e3f2fd;
    border-color: #1a73e8;
}

.converter-tab.active {
    background: #1a73e8;
    color: #fff;
    border-color: #174ea6;
}

.converter-form {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.converter-input, .converter-select {
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1.1em;
    pointer-events: auto !important;
}

.converter-arrow {
    font-size: 1.5em;
    color: #1a73e8;
}

.converter-button {
    grid-column: span 3;
    padding: 12px;
    background: #1a73e8;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    cursor: pointer !important;
    transition: all 0.3s;
    pointer-events: auto !important;
}

.converter-button:hover {
    background: #174ea6;
    transform: scale(1.02);
}

.converter-result {
    grid-column: span 3;
    background: #f0f7fa;
    padding: 15px;
    border-radius: 8px;
    min-height: 50px;
}

.result-display {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: #fff;
    border-radius: 5px;
}

.result-label {
    font-weight: 600;
    color: #555;
}

.result-value {
    color: #1a73e8;
    font-weight: 600;
}

.result-value.highlight {
    color: #34c759;
    font-size: 1.2em;
}

.error {
    color: #ff3b30;
    font-weight: 600;
    text-align: center;
}

/* ===== GRAFIK ===== */
#desmos-applet {
    width: 100%;
    height: 600px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    margin: 20px 0;
}

/* ===== MATERI (Soal + Pembahasan) ===== */
.soal-section {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.soal-question h3 {
    color: #1a73e8;
    font-size: 1.4em;
    margin-bottom: 10px;
}

.soal-answer {
    display: none;
    padding: 20px;
    background: #e3f2fd;
    border-top: 1px solid #e0e0e0;
    margin-top: 15px;
    border-radius: 8px;
}

.toggle-btn, .copy-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer !important;
    font-size: 1em;
    transition: all 0.3s;
    margin: 10px 5px 0 0;
    pointer-events: auto !important;
}

.toggle-btn {
    background: #1a73e8;
    color: #fff;
}

.toggle-btn:hover { 
    background: #174ea6; 
}

.copy-btn {
    background: #34c759;
    color: #fff;
}

.copy-btn:hover { 
    background: #2aa645; 
}

/* ===== PROFIL ADMIN ===== */
.profile-card {
    background: #fff;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.profile-header {
    display: flex;
    gap: 30px;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
}

.profile-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #1a73e8;
}

.profile-info {
    flex: 1;
}

.profile-name {
    color: #1a73e8;
    font-size: 2em;
    margin-bottom: 5px;
}

.profile-title {
    color: #555;
    font-size: 1.2em;
    margin-bottom: 10px;
}

.profile-tagline {
    color: #777;
    font-size: 1em;
}

.section-title {
    color: #1a73e8;
    font-size: 1.5em;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.skills-section, .education-section, .achievements-section, .contact-section {
    margin-bottom: 30px;
}

.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-tag {
    background: #e3f2fd;
    color: #1a73e8;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.timeline {
    border-left: 3px solid #1a73e8;
    padding-left: 20px;
}

.timeline-item {
    margin-bottom: 20px;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -26px;
    top: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #1a73e8;
}

.timeline-date {
    color: #34c759;
    font-weight: 600;
    margin-bottom: 5px;
}

.timeline-content h4 {
    color: #333;
    font-size: 1.1em;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.achievement-card {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #34c759;
}

.achievement-year {
    color: #1a73e8;
    font-weight: 600;
    margin-bottom: 5px;
}

.achievement-title {
    color: #333;
    font-weight: 600;
    margin-bottom: 5px;
}

.achievement-desc {
    color: #777;
    font-size: 0.9em;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.contact-item i {
    color: #1a73e8;
    font-size: 1.5em;
}

.contact-item a {
    color: #1a73e8;
    text-decoration: none;
}

.contact-item a:hover {
    text-decoration: underline;
}

/* ===== FOOTER ===== */
footer {
    background: #f0f7fa;
    color: #333;
    text-align: center;
    padding: 20px;
    margin-top: auto;
    border-top: 1px solid #e0e0e0;
    position: relative;
    z-index: 100;
}

footer p {
    margin-bottom: 10px;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    position: relative;
    z-index: 101;
}

.social-links a {
    color: #1a73e8;
    font-size: 1.4em;
    transition: color 0.3s;
    pointer-events: auto !important;
    cursor: pointer !important;
    display: inline-block;
}

.social-links a:hover { 
    color: #34c759;
    transform: scale(1.2);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .card-grid, .soal-grid { 
        grid-template-columns: 1fr; 
    }
    
    .hero h1 { 
        font-size: 2em; 
    }
    
    .converter-form { 
        grid-template-columns: 1fr; 
    }
    
    .converter-arrow { 
        transform: rotate(90deg); 
        margin: 10px 0; 
    }
    
    .btn-grid { 
        grid-template-columns: repeat(4, 1fr); 
    }
    
    .matrix-input-section {
        grid-template-columns: 1fr;
    }
    
    .matrix-operation-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .achievements-grid {
        grid-template-columns: 1fr;
    }
    
    nav ul {
        flex-direction: column;
        align-items: center;
    }
}