/* ArcoDataHub Custom Styles - Inspired by Earth Data Hub */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    /* IT4LIA - Italian AI Factory Color Palette */
    --primary-teal: #007675;
    --secondary-lime: #AFCA0B;
    --accent-lime: #AFCA11;
    --bg-cream: #F0F3DF;
    --text-dark: #1D1E1B;

    /* Gradient combinations */
    --gradient-start: #007675;
    --gradient-end: #AFCA11;
    --gradient-teal-lime: linear-gradient(135deg, #007675 0%, #AFCA0B 100%);
    --gradient-lime-teal: linear-gradient(135deg, #AFCA11 0%, #007675 100%);

    /* Semantic color mappings */
    --text-primary: #1D1E1B;
    --text-secondary: #4a5548;
    --bg-light: #F0F3DF;
    --bg-gray: #F0F0F0;
    --bg-white: #ffffff;
    --border-light: #d4d8c8;
    --shadow-light: 0 1px 3px 0 rgb(29 30 27 / 0.1), 0 1px 2px -1px rgb(29 30 27 / 0.1);
    --shadow-medium: 0 4px 6px -1px rgb(29 30 27 / 0.1), 0 2px 4px -2px rgb(29 30 27 / 0.1);
    --shadow-large: 0 20px 25px -5px rgb(29 30 27 / 0.1), 0 8px 10px -6px rgb(29 30 27 / 0.1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--bg-light) 0%, #f1f5f9 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Gradient Background Animation */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg,
        rgba(0, 118, 117, 0.03) 0%,
        rgba(175, 202, 11, 0.03) 25%,
        rgba(175, 202, 17, 0.03) 50%,
        rgba(0, 118, 117, 0.03) 75%,
        rgba(175, 202, 11, 0.03) 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    z-index: -1;
    pointer-events: none;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Custom Navbar Styling */
.navbar-custom {
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%) !important;
    box-shadow: var(--shadow-medium);
    backdrop-filter: blur(10px);
    border: none;
    padding: 1rem 0;
}

.navbar-custom .navbar-brand {
    font-weight: 800;
    font-size: 1.5rem;
    color: white !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.navbar-custom .btn {
    border-radius: 25px;
    font-weight: 600;
    padding: 0.5rem 1.5rem;
    margin: 0 0.25rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.navbar-custom .btn-outline-light {
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
}

.navbar-custom .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.navbar-custom .btn-light {
    background: white;
    color: var(--primary-indigo);
    border: none;
}

.navbar-custom .btn-light:hover {
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.navbar-custom .btn-danger {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    border: none;
}

.navbar-custom .btn-danger:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(220, 38, 38, 0.3);
}

/* Welcome Text Animation */
.welcome-text {
    color: white !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    font-weight: 600;
}

/* Container Styling */
.container-main {
    background: var(--bg-white);
    border-radius: 20px;
    box-shadow: var(--shadow-large);
    margin: 2rem auto;
    padding: 3rem;
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

.container-main::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 4rem 0;
    background: linear-gradient(135deg, rgba(240, 243, 223, 0.9) 0%, rgba(255, 255, 255, 0.9) 100%),
                url('/static/datasets/images/aif_bg2_small.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 20px;
    margin-bottom: 3rem;
    box-shadow: var(--shadow-medium);
    position: relative;
    overflow: hidden;
}

.hero-section > * {
    position: relative;
    z-index: 2;
}


.hero-section h1 {
    font-size: 3.5rem;
    font-weight: 800;
    background: var(--gradient-teal-lime);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.5rem;
}

.hero-section p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Alert Styling */
.alert {
    border: none;
    border-radius: 15px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-light);
    border-left: 4px solid;
}

.alert-success {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    border-left-color: #16a34a;
    color: #15803d;
}

.alert-danger {
    background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
    border-left-color: #dc2626;
    color: #dc2626;
}

.alert-info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-left-color: #2563eb;
    color: #1d4ed8;
}

.alert-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fcd34d 100%);
    border-left-color: #d97706;
    color: #b45309;
}

/* Form Styling */
.form-control {
    border: 2px solid var(--border-light);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--bg-white);
}

.form-control:focus {
    border-color: var(--primary-teal);
    box-shadow: 0 0 0 3px rgba(0, 118, 117, 0.1);
    background: white;
}

.form-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* Button Styling */
.btn {
    border-radius: 12px;
    font-weight: 600;
    padding: 0.75rem 2rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--gradient-teal-lime);
    color: white;
    box-shadow: var(--shadow-light);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    background: linear-gradient(135deg, #005d5c 0%, #9bb609 100%);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, var(--secondary-lime) 0%, var(--accent-lime) 100%);
    color: var(--text-dark);
    font-weight: 600;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    background: linear-gradient(135deg, #9bb609 0%, #9bb60f 100%);
    color: var(--text-dark);
}

.btn-outline-primary {
    border: 2px solid var(--primary-teal);
    color: var(--primary-teal);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-teal);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* Code Block Styling */
pre {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border-radius: 15px;
    padding: 2rem;
    overflow-x: auto;
    box-shadow: var(--shadow-medium);
    border: 1px solid #374151;
    position: relative;
}

code {
    color: #f1f5f9;
    font-family: 'SF Mono', Monaco, Inconsolata, 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Code elements in light backgrounds need darker text */
.bg-light code,
.alert code {
    color: var(--text-dark) !important;
    background-color: rgba(0, 118, 117, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

/* Card Styling */
.card {
    border: none;
    border-radius: 20px;
    box-shadow: var(--shadow-light);
    overflow: hidden;
    transition: all 0.3s ease;
    background: var(--bg-white);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-large);
}

.card-header {
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    color: white;
    border: none;
    padding: 1.5rem;
    font-weight: 600;
}

.card-body {
    padding: 2rem;
    background: var(--bg-light);
}

/* Table Styling */
.table {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-light);
    background: var(--bg-white);
}

.table th {
    background: var(--gradient-teal-lime);
    color: white;
    border: none;
    font-weight: 600;
    padding: 1rem;
}

.table td {
    padding: 1rem;
    border-color: var(--border-light);
    vertical-align: middle;
}

.table-striped tbody tr:nth-of-type(odd) {
    background: #f8fafc;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2.5rem;
    }

    .container-main {
        margin: 1rem;
        padding: 2rem;
        border-radius: 15px;
    }

    .navbar-custom .btn {
        margin: 0.25rem 0;
        padding: 0.5rem 1rem;
    }

    pre {
        padding: 1.5rem;
        border-radius: 12px;
    }
}

/* Footer Styling */
.footer-dark {
    background-color: var(--text-dark) !important;
    border-top: 3px solid var(--primary-teal);
}

.footer-dark h6 {
    color: var(--secondary-lime);
    font-weight: 700;
}

.footer-dark .text-light {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Utility Classes */
.text-gradient {
    background: var(--gradient-teal-lime);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient {
    background: var(--gradient-teal-lime);
}

.shadow-custom {
    box-shadow: var(--shadow-large);
}

.border-radius-custom {
    border-radius: 20px;
}

/* Loading Animation */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}