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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

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

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

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

.ratio-dashboard {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    border: 2px solid #e74c3c;
}

.ratio-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.ratio-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.ratio-label {
    font-weight: bold;
    font-size: 1.1rem;
}

.ratio-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #2c3e50;
    font-family: 'Courier New', monospace;
}

.ratio-equals {
    font-size: 2rem;
    font-weight: bold;
    color: #2c3e50;
    transition: all 0.3s ease;
}

.ratio-equals.pulse {
    animation: pulse 1s ease-in-out infinite;
    color: #e74c3c;
    transform: scale(1.2);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.canvas-container {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    text-align: center;
}

#canvas {
    border: 2px solid #ecf0f1;
    border-radius: 10px;
    background: #f8f9fa;
    max-width: 100%;
    height: auto;
    cursor: default;
    touch-action: none;
}

.controls {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.reset-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

.instructions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.drag-hint {
    color: #7f8c8d;
    font-style: italic;
    font-size: 0.9rem;
}

.formula-container {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.formula-border {
    border: 3px dashed #9b59b6;
    border-radius: 10px;
    padding: 20px;
    background: linear-gradient(45deg, #f8f9fa, #ffffff);
}

.formula-content {
    text-align: center;
}

.formula-title {
    display: block;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 15px;
    color: #2c3e50;
}

.formula-text {
    font-size: 1.5rem;
    font-weight: bold;
    font-family: 'Times New Roman', serif;
    color: #2c3e50;
}

.footer {
    text-align: center;
    color: white;
    opacity: 0.8;
    margin-top: 40px;
}

.footer a {
    color: #e74c3c;
    text-decoration: none;
    font-weight: bold;
}

.footer a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .ratio-display {
        flex-direction: column;
        gap: 15px;
    }
    
    .ratio-equals {
        transform: rotate(90deg);
        font-size: 1.5rem;
    }
    
    .ratio-equals.pulse {
        transform: rotate(90deg) scale(1.2);
    }
    
    .controls {
        flex-direction: column;
        text-align: center;
    }
    
    .formula-text {
        font-size: 1.2rem;
    }
    
    #canvas {
        width: 100% !important;
        height: auto !important;
    }
}

@media (max-width: 480px) {
    .ratio-dashboard {
        padding: 15px;
    }
    
    .ratio-value {
        font-size: 1.4rem;
    }
    
    .formula-border {
        padding: 15px;
    }
    
    .canvas-container {
        padding: 15px;
    }
}