/* css/base.css - Base styles and common components */

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

:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1f2937;
    --gray: #6b7280;
    --light: #f9fafb;
    --white: #ffffff;
    --border: #e5e7eb;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    padding: 0;
    line-height: 1.6;
}

.container {
    max-width: 100%;
    margin: 0;
    background: var(--white);
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
    min-height: 100vh;
}

/* Header */
.header {
    background: var(--dark);
    color: var(--white);
    padding: 20px;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 15px;
}

.nav-buttons {
    display: flex;
    gap: 10px;
}

.nav-btn {
    background: transparent;
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-btn.active {
    background: var(--white);
    color: var(--dark);
    border-color: var(--white);
}

/* Upload Section */
.upload-section {
    padding: 20px;
    background: var(--light);
    border-bottom: 1px solid var(--border);
}

.file-input-wrapper {
    display: inline-block;
    background: var(--primary);
    color: var(--white);
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    font-size: 14px;
}

.file-input-wrapper:hover {
    background: var(--primary-dark);
}

.file-input-wrapper input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

img.logo {
    filter: brightness(0) invert(1);
}

.month-selector {
    display: none;
}

.month-selector select {
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid var(--border);
    font-size: 14px;
}

/* Views */
.view {
    padding: 20px;
    display: none;
}

.view.active {
    display: block;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    font-weight: 500;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--light);
    color: var(--dark);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-text {
    background: transparent;
    border: none;
    color: var(--primary);
    cursor: pointer;
    padding: 4px 8px;
    font-size: 12px;
    text-decoration: underline;
}

.btn-text:hover {
    color: var(--primary-dark);
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--gray);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.btn-icon:hover {
    background: var(--white);
    color: var(--danger);
}

.btn-warning {
    background: var(--warning);
    color: var(--white);
}

.btn-warning:hover {
    background: #dc8a04;
}

/* Loading */
.loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 4px;
    color: var(--white);
    z-index: 2000;
    animation: slideIn 0.3s ease;
    font-size: 14px;
}

.notification.success {
    background: var(--success);
}

.notification.error {
    background: var(--danger);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        padding: 15px 10px;
    }

    .header > div {
        flex-direction: row !important; /* Keep horizontal */
        gap: 15px;
    }

    /* Hamburger menu button */
    .menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        width: 30px;
        height: 25px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 10;
    }

    .menu-toggle span {
        width: 100%;
        height: 3px;
        background: white;
        border-radius: 10px;
        transition: all 0.3s;
    }

    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }

    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }

    /* Mobile navigation */
    .nav-buttons {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        max-width: 300px;
        height: 100vh;
        background: var(--dark);
        flex-direction: column;
        padding: 80px 20px 20px;
        gap: 10px;
        transition: right 0.3s ease;
        z-index: 9;
        overflow-y: auto;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3);
    }

    .nav-buttons.active {
        right: 0;
    }

    .nav-btn,
    .help-btn {
        width: 100%;
        padding: 12px 16px;
        font-size: 14px;
        text-align: left;
    }

    .help-btn {
        border-radius: 4px;
        width: 100%;
        height: auto;
    }

    /* Overlay when menu is open */
    .nav-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 8;
    }

    .nav-overlay.active {
        display: block;
    }
}
