/* TO DO:
- Make sure classes are adopted in html file
- Understand each line of the codebase
- Remove duplication
- Improve styling
*/


/* Universal selector: reset margins, padding, and set global font */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Body: Modern gradient background with flexbox layout */
body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #333;
    line-height: 1.6;
    padding: 0;
}

/* Glassy styling for reusable translucent effect */
.glassy {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glassy:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
}

/* Special case for header: remove border-radius for full-width effect */
header.glassy {
    border-radius: 0;
    border-left: none;
    border-right: none;
}

/* Header: full-width glassmorphism effect */
header {
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 2rem 0;
    text-align: center;
    margin: 0;
}

/* Header container: centered content within full-width header */
.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
    width: 100%;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    margin-bottom: 1rem;
    animation: glow 2s ease-in-out infinite alternate;
}

.subtitle {
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
    max-width: 750px;
    margin: 0 auto;
}

/* Dashboard: Modern glassmorphism layout with grid */
.dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    max-width: 1200px;
    margin: 3rem auto 20px auto;
    padding: 30px;
    width: 100%;
}

/* Section: Generic styling for input and output sections */
.section {
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
}

.section h2 {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Input group: Vertical layout for input fields */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input, select {
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 0.6rem 1rem;
    color: #4a5568;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s ease;
}

input:focus, select:focus {
    background: rgba(255, 255, 255, 1);
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

input:hover, select:hover {
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

/* Output container: 2x2 grid for financial metric cards */
.output-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.output-card {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    transition: transform 0.3s ease;
}

.output-card:hover {
    transform: translateY(-3px);
}

.output-card h3 {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 10px;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
}

.output-card p {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.4rem;
    font-weight: bold;
}

.indicator {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    margin-left: 10px;
}

.high { background: #34d399; color: white; }
.medium { background: #f59e0b; color: white; }
.low { background: #ef4444; color: white; }

.visualization {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
}

canvas {
    width: 100% !important;
    height: 200px !important;
}

.recommendation {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    border-radius: 15px;
    margin-top: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    padding: 1.2rem 2rem;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

button:hover::before {
    left: 100%;
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

button:active {
    transform: translateY(-1px);
}

@keyframes glow {
    from { text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3), 0 0 20px rgba(255, 255, 255, 0.2); }
    to { text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3), 0 0 30px rgba(255, 255, 255, 0.4); }
}

@media (max-width: 768px) {
    .dashboard {
        grid-template-columns: 1fr;
        margin: 2rem 15px 20px 15px;
        padding: 2rem;
    }

    .header-container {
        padding: 0 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
}