/**
 * RED Solidaria - Main Stylesheet
 * Comprehensive styling for all pages including responsive design
 * Color scheme: Red accent (#dc2626) on neutral background (#f5f2eb)
 */

/* ===== CSS CUSTOM PROPERTIES (Variables) ===== */
:root {
    --bg-color: #f5f2eb;
    --text-color: #111827;
    --accent-color: #dc2626;
    --accent-hover: #b91c1c;
    --accent-focus: #1d4ed8;
    --nav-bg: #ffffff;
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 2px 15px rgba(0, 0, 0, 0.03);
    --shadow-accent: 0 4px 6px rgba(220, 38, 38, 0.2);
    --shadow-accent-lg: 0 6px 12px rgba(220, 38, 38, 0.25);
    --shadow-blue: 0 4px 6px rgba(37, 99, 235, 0.2);
    --shadow-blue-lg: 0 6px 12px rgba(37, 99, 235, 0.15);
    --border-color: #e5e7eb;
}

/* Global box-sizing for consistent layouts */
* {
    box-sizing: border-box;
}

/* Base font configuration */
html {
    font-size: 15px !important; 
}

/* ===== LAYOUT & CONTAINER ===== */

.container {
    max-width: 800px;
    margin: 1.5rem auto;
    padding: 3rem;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    animation: fadeSlideUp 0.6s ease-out forwards; 
}

/* Page background and body setup */
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    padding-left: 270px; 
}

/* ===== TYPOGRAPHY ===== */
/* Ensure text color consistency across all elements */

h1, h2, h3, h4, h5, h6, p, span, label, li, td, th {
    color: inherit;
}

/* ===== NAVIGATION SIDEBAR ===== */
/* Fixed left sidebar with vertical layout, persistent across pages */

nav {
    background-color: var(--nav-bg);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 210px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 0;
    border-right: 1px solid var(--border-color);
    animation: fadeIn 0.8s ease-out forwards;
}

/* Navigation list styling */
.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 0;
    padding: 0;
    width: 100%;
}

/* Navigation list items - constrained width for text wrapping */
.nav-links li {
    width: 100%;
    text-align: center;
    max-width: 140px;
    margin: 0 auto;
}

/* Navigation links - standard styling */
.nav-links a {
    text-decoration: none;
    color: #4b5563;
    font-weight: 500;
    font-size: 1.05rem;
    transition: color 0.2s;
    display: block;
    padding: 0.5rem 0;
    word-wrap: break-word;
    white-space: normal;
    word-break: break-word;
}

/* Navigation link hover effect */
.nav-links a:hover {
    color: var(--accent-color);
}

/* CV Button - Red action button */
.nav-links a.cv-button {
    background-color: var(--accent-color);
    color: white !important;
    padding: 0.6rem 1.5rem !important;
    font-size: 1.05rem;
    border-radius: 6px;
    font-weight: 600;
    display: inline-block;
    margin-top: 1rem;
    box-shadow: var(--shadow-blue);
    transition: all 0.3s ease;
    border: none !important;
}

/* CV Button hover with elevation effect */
.nav-links a.cv-button:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px); 
    box-shadow: var(--shadow-accent-lg);
}

/* ===== FORMS & INPUT FIELDS ===== */
/* Form styling with consistent spacing and focus states */

form {
    max-width: 1000px;
}

/* Form group containers */
.form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
}

/* Form labels */
.form-group label {
    font-weight: 500;
    color: #4b5563;
    font-size: 0.95rem;
}

/* All input elements - consistent styling */
input, textarea, select {
    padding: 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 0.5rem;
    font-family: inherit;
    background-color: #f9fafb;
    color: #374151;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

/* Input focus states - accent color highlighting */
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent-color);
    background-color: white;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

/* Submit buttons - red action styling */
button[type="submit"] {
    background-color: var(--accent-color);
    color: white;
    padding: 0.85rem 2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    width: 100%;
    margin-top: 1rem;
    box-shadow: var(--shadow-blue);
    transition: all 0.3s ease;
}

/* Submit button hover effect */
button[type="submit"]:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px); 
    box-shadow: var(--shadow-accent-lg);
}

/* Logo styling - centered and responsive */
.logo {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 0.5rem;
    position: static; 
}

.nav-logo {
    height: 150px;
    width: auto;
}

/* Login Button - matches CV button styling */
.nav-links a.login-button {
    background-color: var(--accent-color) !important;
    color: white !important;
    padding: 0.6rem 1.5rem !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    font-size: 1.05rem !important;
    display: inline-block !important;
    margin-top: 1rem !important;
    transition: all 0.3s ease !important;
    border: none !important;
    text-align: center !important;
}

/* Login button hover state */
.nav-links a.login-button:hover {
    background-color: var(--accent-hover);
    color: white !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-accent-lg);
}

/* ===== ANIMATIONS ===== */
/* Smooth entrance animations for visual appeal */

@keyframes fadeSlideUp {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* ===== DETAILED FORM INPUT STYLING ===== */
/* Additional specific input styling for consistency */

input[type="text"], input[type="email"], input[type="tel"], 
input[type="password"], select, textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-family: inherit;
    background-color: white;
    transition: all 0.3s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

/* ===== CHECKBOXES & FIELDSETS ===== */
/* Styling for checkbox grids and form sections */

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
    gap: 1rem;
    margin-top: 1rem;
    align-items: start;
}

.checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.9rem;
    line-height: 1.4; 
}

.checkbox-item input {
    margin-top: 0.15rem;
    flex-shrink: 0;
}

/* Fieldset - grouped form sections */
fieldset {
    border: 1px solid var(--border-color);
    background-color: #ffffff;
    margin-top: 2rem; 
    margin-bottom: 2.5rem;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

/* Section titles within fieldsets */
.section-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-color);
    margin-top: 0;
    margin-bottom: 1.5rem; 
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--accent-color);
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablet */
@media (max-width: 1024px) {
    body {
        padding-left: 220px;
    }
    nav {
        width: 180px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    /* Layout */
    body {
        padding-left: 0;
        font-size: 14px;
    }

    /* Nav - horizontal bar on top */
    nav {
        position: relative;
        width: 100%;
        height: auto;
        padding: 1rem;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        flex-direction: column;
        align-items: center;
    }

    .logo {
        margin-bottom: 0.75rem;
    }

    .nav-logo {
        height: 60px;
    }

    .nav-links {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
        padding: 0 0.5rem;
    }

    .nav-links li {
        max-width: none;
    }

    .nav-links a {
        font-size: 0.9rem;
        padding: 0.4rem 0.6rem;
    }

    .nav-links a.cv-button,
    .nav-links a.login-button {
        margin-top: 0.25rem;
        padding: 0.5rem 1rem !important;
        font-size: 0.9rem !important;
    }

    /* Container */
    .container {
        margin: 1rem 0.75rem;
        padding: 1.25rem;
        border-radius: 8px;
    }

    /* Typography */
    .text-title {
        font-size: 1.6rem;
        margin-bottom: 1.25rem;
    }

    .text-heading {
        font-size: 1.3rem;
    }

    .text-large {
        font-size: 1rem;
        line-height: 1.7;
    }

    /* Grid - stack on mobile */
    .grid-2col {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Forms */
    fieldset {
        padding: 1.25rem;
        margin-top: 1.25rem;
        margin-bottom: 1.5rem;
    }

    .section-title {
        font-size: 1.1rem;
    }

    input, textarea, select {
        font-size: 16px !important; /* Prevents iOS zoom on focus */
        padding: 0.7rem;
    }

    button[type="submit"] {
        padding: 0.9rem;
        font-size: 1rem;
    }

    /* Checkbox grid - single column on small screens */
    .checkbox-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .checkbox-item {
        font-size: 0.95rem;
    }

    /* Forms - full width inputs */
    .form-group {
        margin-bottom: 1.25rem;
    }

    .form-group label {
        font-size: 0.95rem;
    }

    /* Admin panel */
    .admin-container {
        padding: 1rem;
    }

    .header-bar {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
        padding: 1rem 1.25rem;
    }

    .header-bar h2 {
        font-size: 1.3rem;
    }

    .admin-links {
        gap: 1rem;
        flex-wrap: wrap;
    }

    .table-wrapper {
        height: 60vh;
    }

    /* Tab buttons */
    .tab-nav, .emp-tab-nav {
        flex-wrap: wrap;
    }

    .tab-btn, .emp-tab-btn {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
    }

    /* Modal */
    .modal-box {
        padding: 1.5rem;
        max-width: 95%;
    }

    /* Login page */
    .login-box {
        padding: 1.5rem;
        margin: 1rem;
    }

    /* Entrepreneur cards */
    .grid-cards {
        grid-template-columns: 1fr;
    }

    /* Max width containers */
    .max-width-900,
    .max-width-750 {
        max-width: 100%;
    }

    /* Hide image and its container on mobile, center text */
    .img-responsive {
        display: none;
    }

    .text-center {
        display: none;
    }

    .grid-2col {
        grid-template-columns: 1fr;
    }

    .grid-2col > div {
        text-align: center;
    }
}

/* Very small phones */
@media (max-width: 380px) {
    .container {
        margin: 0.5rem;
        padding: 1rem;
    }

    .text-title {
        font-size: 1.4rem;
    }

    .nav-links a.cv-button,
    .nav-links a.login-button {
        font-size: 0.8rem !important;
        padding: 0.4rem 0.8rem !important;
    }
}

/* ===== UTILITY CLASSES ===== */
/* Reusable helper classes for common styling patterns */

/* Typography Utilities */
.text-large { font-size: 1.1rem; line-height: 1.8; }
.text-title { font-size: 2.5rem; margin-bottom: 2rem; }
.text-heading { font-size: 1.75rem; font-weight: 700; margin-bottom: 1rem; }
.text-center { text-align: center; }

/* Spacing Utilities */
.mt-lg { margin-top: 2.5rem; }
.mb-lg { margin-bottom: 2rem; }
.mb-md { margin-bottom: 1.5rem; }
.p-top { padding-top: 2rem; }

/* Grid Utilities */
.grid-2col { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 3rem; align-items: start; }
.grid-start { align-content: start; }

/* Image Utilities */
.img-responsive { max-width: 100%; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); object-fit: cover; }

/* Container Utilities */
.max-width-900 { max-width: 900px; }
.max-width-750 { max-width: 750px; }
.center-content { display: flex; justify-content: center; align-items: center; }

/* Link Utilities */
.link-reset { text-decoration: none; color: inherit; }

/* ===== ACCESSIBILITY ===== */
/* Support for users who prefer reduced motion */

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

footer {
    padding: 1.2rem 3rem 1.2rem 300px;
    text-align: center;
    font-size: 0.85rem;
    color: #6b7280;
    animation: fadeSlideUp 0.6s ease-out forwards;
}
footer a { color: #6b7280; text-decoration: underline; }
footer a:hover { color: var(--accent-color); }

@media (max-width: 768px) {
    footer { padding: 1.2rem; }
}