/* ========================================
   SISTEMA DE DISSENY BASE - UTILITY
   ========================================
   Fitxer CSS base genÃ¨ric per a desenvolupadors
   
   AQUEST FITXER CONTÃ‰:
   âœ… Variables CSS (colors, spacing, radius, transitions)
   âœ… Reset CSS i estils base
   âœ… Tipografia estandarditzada
   âœ… Elements base genÃ¨rics (.btn, .card, .grid, .container)
   âœ… Classes utilitÃ ries (.text-center, .mb-1, .flex, etc.)
   âœ… Responsive design base
   âœ… Animacions i transicions base
   
   ÃšS: Descarrega aquest fitxer i utilitza'l com a base
   per a la teva aplicaciÃ³ web. Afegeix les teves prÃ²pies
   classes CSS especÃ­fiques a partir d'aquÃ­.
   ======================================== */

/* ========================================
   VARIABLES CSS - PALETA UTILITY
   ======================================== */
   :root {
    /* Paleta Principal - Colors Utility */
    --primary-blue: #437697;           /* Color principal */
    --primary-blue-dark: #365a7a;      /* Color principal fosc (hover) */
    --primary-blue-light: #5a8bb8;     /* Color principal clar */
    --secondary-blue: #6b9bc7;         /* Color secundari */
    --accent-blue: #8bb3d9;            /* Color d'accent */
    
    /* Colors d'AcciÃ³ */
    --success-green: #28a745;          /* Verd per a guardar */
    --success-green-dark: #1e7e34;     /* Verd fosc (hover) */
    --danger-red: #dc3545;             /* Vermell per a eliminar */
    --danger-red-dark: #c82333;        /* Vermell fosc (hover) */
    
    /* Colors de Text i Fons */
    --text-dark: #2c3e50;              /* Text principal */
    --text-medium: #5a6c7d;            /* Text secundari */
    --text-light: #7f8c8d;             /* Text clar */
    --white: #ffffff;                   /* Blanc */
    --background-light: #f8f9fa;        /* Fons clar */
    --background-white: #ffffff;        /* Fons blanc */
    --background-gray: #F3F4F6;         /* Fons gris */
    --footer-border-color: #D3D3D3;     /* Color del borde del footer */
    
    /* Ombres i TransparÃ¨ncies */
    --shadow-light: rgba(67, 118, 151, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.1);
    --shadow-dark: rgba(0, 0, 0, 0.15);
    --shadow-blue: rgba(67, 118, 151, 0.2);
    
    /* Transicions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.4s ease;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 25px;
    
    /* Espaiat */
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 40px;
    --spacing-3xl: 48px;
}

/* ========================================
   RESET I BASE
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--background-light), #e9ecef);
    color: var(--text-dark);
    line-height: 1.6;
    /* padding: var(--spacing-md); REMOVE THIS */
    min-height: 100vh;
}

/* ========================================
   TIPOGRAFIA
   ======================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
}

h1 {
    font-size: 3.5rem;
    margin-bottom: var(--spacing-md);
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

h2 {
    font-size: 2rem;
    margin-bottom: var(--spacing-lg);
    text-align: center;
    color: var(--text-dark);
}

h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

p {
    margin-bottom: var(--spacing-md);
    line-height: 1.7;
}

a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: color var(--transition-normal);
}

a:hover {
    color: var(--primary-blue-dark);
}

/* ========================================
   ELEMENTS BASE GENÃˆRICS
   ======================================== */

/* Botons base */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.95rem;
    text-decoration: none;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-align: center;
    min-height: 44px;
}

.btn:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* BotÃ³ Principal */
.btn-primary {
    background: var(--primary-blue);
    color: var(--white);
    box-shadow: 0 5px 15px var(--shadow-blue);
}

.btn-primary:hover {
    background: var(--primary-blue-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow-blue);
}

/* BotÃ³ Secundari (Outline) */
.btn-secondary {
    background: transparent;
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
}

.btn-secondary:hover {
    background: var(--primary-blue);
    color: var(--white);
    transform: translateY(-2px);
}

/* BotÃ³ d'Ãˆxit */
.btn-success {
    background: var(--success-green);
    color: var(--white);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.btn-success:hover {
    background: var(--success-green-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
}

/* BotÃ³ de Perill */
.btn-danger {
    background: var(--danger-red);
    color: var(--white);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.3);
}

.btn-danger:hover {
    background: var(--danger-red-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.4);
}

/* Cards base */
.card {
    background: var(--background-gray);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 10px 30px var(--shadow-medium);
    transition: all var(--transition-slow);
    border: 3px solid transparent;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 50px var(--shadow-dark);
    border-color: var(--primary-blue);
}

/* Grid base */
.grid {
    display: grid;
    gap: var(--spacing-lg);
}

/* REMOVE THIS
.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
*/

.grid-cols-auto-fit { grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); }
.grid-cols-auto-fill { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

/* Layout base */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.container-fluid {
    max-width: 100%;
    margin: 0;
    padding: 0 var(--spacing-md);
}

.section {
    padding: var(--spacing-4xl) var(--spacing-3xl);
}

.section-sm {
    padding: var(--spacing-2xl) var(--spacing-xl);
}

.section-lg {
    padding: var(--spacing-4xl) var(--spacing-3xl);
}

/* ========================================
   UTILITATS
   ======================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }
.mb-5 { margin-bottom: var(--spacing-xl); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }
.mt-5 { margin-top: var(--spacing-xl); }

.p-0 { padding: 0; }
.p-1 { padding: var(--spacing-xs); }
.p-2 { padding: var(--spacing-sm); }
.p-3 { padding: var(--spacing-md); }
.p-4 { padding: var(--spacing-lg); }
.p-5 { padding: var(--spacing-xl); }

.hidden { display: none; }
.visible { display: block; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

/* ========================================
   RESPONSIVE DESIGN BASE
   ======================================== */
@media (max-width: 768px) {
    body {
        /* padding: var(--spacing-sm); REMOVE THIS */
    }
    
    h1 {
        font-size: 2.8rem;
    }
    
    h2 {
        font-size: 1.8rem;
    }
    
    h3 {
        font-size: 1.6rem;
    }
    
    .section {
        padding: var(--spacing-2xl) var(--spacing-lg);
    }
    
    .section-sm {
        padding: var(--spacing-xl) var(--spacing-lg);
    }
    
    .section-lg {
        padding: var(--spacing-2xl) var(--spacing-lg);
    }
    
    .grid-cols-auto-fit,
    .grid-cols-auto-fill {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2.4rem;
    }
    
    h2 {
        font-size: 1.6rem;
    }
    
    h3 {
        font-size: 1.4rem;
    }
    
    .section {
        padding: var(--spacing-xl) var(--spacing-md);
    }
    
    .section-sm {
        padding: var(--spacing-lg) var(--spacing-md);
    }
    
    .section-lg {
        padding: var(--spacing-xl) var(--spacing-md);
    }
}

/* ========================================
   ANIMACIONS I TRANSICIONS
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.slide-in {
    animation: slideIn 0.5s ease-out;
}

.fade-in-down {
    animation: fadeInDown 0.8s ease-out;
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* ========================================
   ACCESSIBILITAT
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus visible per a navegaciÃ³ per teclat */
button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    .project-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .back-button {
        display: none;
    }
}

hr {
  width: 100%;
  border-color: var(--primary-blue);
}

input.form-control {
  width: 100%;
  max-width: 100%;
  border-color: var(--primary-blue);
}