* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.4;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 8px;
}

.header-section {
    color: white;
    text-align: center;
    margin-bottom: 12px;
}

.header-section h1 {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 0.9rem;
    font-weight: 300;
    opacity: 0.9;
    margin: 0;
}

.accuracy-notice {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    margin: 8px auto 0;
    max-width: 400px;
    backdrop-filter: blur(10px);
}

.accuracy-notice p {
    font-size: 0.85rem;
    font-weight: 500;
    margin: 0;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}



/* Main content layout - side by side */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.question-container {
    background: white;
    border-radius: 16px;
    padding: 15px;
    margin-bottom: 0;
    box-shadow: 0 15px 45px rgba(0,0,0,0.1);
    min-height: 450px;
    display: flex;
    flex-direction: column;
}

.question-header {
    text-align: center;
    margin-bottom: 10px;
}

.question-header h2 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: #333;
}



.input-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 10px;
}

.rectangular-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.polar-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.polar-group.with-separator {
    border-top: 2px solid #666;
    padding-top: 15px;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-weight: 500;
    margin-bottom: 6px;
    color: #555;
    font-size: 0.9rem;
}

.input-group input {
    padding: 10px 14px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: 'JetBrains Mono', monospace;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}



.input-with-validation {
    position: relative;
    display: flex;
    align-items: center;
}

.validation-indicator {
    position: absolute;
    right: 12px;
    font-size: 18px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.validation-indicator.correct {
    color: #28a745;
    opacity: 1;
}

.validation-indicator.incorrect {
    color: #dc3545;
    opacity: 1;
}

.input-instructions {
    background: #f8f9fa;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 10px;
    text-align: center;
}

.input-instructions p {
    margin: 0;
    font-size: 0.9rem;
    color: #555;
    line-height: 1.4;
}

.input-instructions p:first-child {
    font-weight: 600;
    color: #667eea;
    margin-bottom: 8px;
}

.button-group {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #e1e5e9;
}

.btn-secondary:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.btn-outline {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
}

.feedback {
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 8px;
    font-weight: 500;
    display: none;
    font-size: 0.9rem;
    max-height: 60px;
    overflow: hidden;
}

.feedback.correct {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.feedback.incorrect {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}



.math {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    color: #667eea;
    font-weight: 500;
}

.vector-visualization {
    background: white;
    border-radius: 16px;
    padding: 15px;
    margin-bottom: 0;
    box-shadow: 0 15px 45px rgba(0,0,0,0.1);
    min-height: 400px;
}

.vector-visualization h3 {
    text-align: center;
    margin-bottom: 10px;
    color: #333;
    font-size: 1rem;
}

.canvas-container {
    text-align: center;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 8px;
    position: relative;
}

#vector-canvas {
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    background: white;
    max-width: 100%;
    height: auto;
}

.zoom-controls {
    position: static;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.zoom-btn {
    width: 32px;
    height: 32px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.zoom-btn:hover {
    background: #667eea;
    color: white;
    transform: scale(1.05);
}

.zoom-btn:active {
    transform: scale(0.95);
}

.zoom-level {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #667eea;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: bold;
    color: #667eea;
    text-align: center;
    min-width: 40px;
}

.zoom-note {
    font-size: 12px;
    color: #666;
    font-weight: normal;
}

/* Mobile responsive zoom controls */
@media (max-width: 480px) {
    .zoom-controls {
        position: static;
        flex-direction: row;
        justify-content: center;
        margin-top: 8px;
        flex-wrap: wrap;
    }
    
    .zoom-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .zoom-level {
        width: 100%;
        margin-top: 8px;
        order: 4;
    }
}

.about-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 20px;
    cursor: pointer;
}

.about-icon {
    font-size: 20px;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.about-text {
    font-size: 14px;
    color: #333;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.about-trigger:hover .about-icon,
.about-trigger:hover .about-text,
.about-trigger.active .about-icon,
.about-trigger.active .about-text {
    opacity: 1;
}

.about-section {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 280px;
    max-width: 90vw;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1000;
}

.about-trigger:hover .about-section,
.about-trigger.active .about-section {
    opacity: 1;
    visibility: visible;
}

/* Mobile-friendly adjustments */
@media (max-width: 480px) {
    .about-section {
        min-width: 250px;
        max-width: 85vw;
        left: 0;
        transform: none;
        margin-left: 10px;
        margin-right: 10px;
    }
}

.about-section h3 {
    margin: 0 0 8px 0;
    color: #495057;
    font-size: 16px;
}

.about-section p {
    margin: 0;
    color: #6c757d;
    font-size: 13px;
    line-height: 1.4;
}

.vector-info {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.vector-details {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.vector-details h4 {
    color: #667eea;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.vector-details div {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: #333;
    line-height: 1.3;
}



@media (max-width: 768px) {
    .container {
        padding: 8px;
    }
    
    .header-section h1 {
        font-size: 1.8rem;
    }
    
    .main-content {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .question-container {
        padding: 15px;
    }
    
    .rectangular-group,
    .polar-group {
        grid-template-columns: 1fr;
    }
    
    .button-group {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 280px;
    }
    
    .vector-visualization {
        padding: 15px;
    }
    
    #vector-canvas {
        width: 100%;
        height: auto;
    }
    
    .vector-info {
        grid-template-columns: 1fr;
    }
}
