/* Base Variables and Reset */
:root {
    --bg-dark: #0f111a;
    --card-bg: rgba(25, 28, 41, 0.65);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f0f2f5;
    --text-secondary: #9ba1b0;
    
    --primary-glow: #6366f1;
    --secondary-glow: #a855f7;
    --accent: #14b8a6;
    --danger: #ef4444;
    --success: #22c55e;
    
    --font-family: 'Outfit', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 3rem 0.5rem; /* Reduced side padding to 0.5rem to be very close to the edge */
    position: relative;
    overflow-x: hidden;
}

/* Dynamic Background Glows */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.5;
    animation: drift 20s infinite alternate ease-in-out;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: var(--primary-glow);
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 300px;
    height: 300px;
    background: var(--secondary-glow);
    bottom: -100px;
    right: -100px;
    animation-delay: -5s;
}

@keyframes drift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 100px) scale(1.2); }
}

/* Layout */
.container {
    max-width: 100%;
    width: 98%; /* 98% allows it to sit perfectly near the edge */
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, #a855f7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 300;
}

.calculator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* Glassmorphism Cards */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.card h2 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #fff;
    font-weight: 600;
}

.icon {
    font-size: 1.4rem;
}

/* Form Elements */
.input-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.25rem;
}

.input-group-row {
    display: flex;
    gap: 1rem;
}

.input-group-row .input-group {
    flex: 1;
}

label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: var(--text-secondary);
    color: var(--bg-dark);
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: bold;
    cursor: help;
    margin-left: 0.5rem;
}

input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    padding: 0.8rem 1rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
    outline: none;
}

input:focus {
    border-color: var(--primary-glow);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
    background: rgba(0, 0, 0, 0.4);
}

.helper-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

#calculatedDailyRate {
    color: var(--accent);
}

/* Summary Section */
.summary-card {
    grid-column: 1 / -1; /* Spans full width */
    background: linear-gradient(135deg, rgba(25, 28, 41, 0.8) 0%, rgba(15, 17, 26, 0.9) 100%);
    border-top: 4px solid var(--primary-glow);
}

.summary-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    font-size: 1rem;
    color: var(--text-secondary);
}

.summary-item.plus span:last-child {
    color: var(--success);
    font-weight: 500;
}

.summary-item.minus span:last-child {
    color: var(--danger);
    font-weight: 500;
}

.summary-item span:last-child {
    font-family: monospace;
    font-size: 1.1rem;
}

.divider {
    height: 1px;
    background: var(--card-border);
    margin: 1.5rem 0;
}

.net-salary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
}

.net-salary .highlight {
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--accent), var(--primary-glow));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: monospace;
}

/* Responsive */
@media (max-width: 768px) {
    .calculator-grid {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 2.2rem;
    }
    
    .net-salary {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .net-salary .highlight {
        font-size: 2rem;
    }
}
