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

:root {
    --primary: #D3052C;
    --primary-hover: #b00424;
    --primary-light: #ffebed;
    --secondary: #333333;
    --bg-light: #f8f9fa;
    --bg-card: #FFFFFF;
    --text-main: #2d3436;
    --text-muted: #636e72;
    --border: #e9ecef;
    --success: #27ae60;
    --error: #e74c3c;
    --warning: #f1c40f;
    --header-bg: #FFFFFF;
    --nav-height: 80px;
}

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

body {
    font-family: 'Catamaran', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
}

h1,
h2,
h3,
h4 {
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1rem;
}

/* Layout */
#app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem 3rem 1.5rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 2rem;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -2px;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, #ff4757 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Navbar Style (CAF Madrid style) */
#nav-container {
    background-color: var(--header-bg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    margin-bottom: 1rem;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    height: var(--nav-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
}

.logo {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -1px;
}

/* Cards (Clean & White) */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.glass {
    /* Adapted for light theme */
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
}

/* Buttons (Rounded & Solid) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border-radius: 30px;
    font-weight: 700;
    font-family: 'Raleway', sans-serif;
    text-transform: uppercase;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    gap: 0.5rem;
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(211, 5, 44, 0.3);
}

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

.btn-outline:hover {
    background-color: var(--primary);
    color: #FFFFFF;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-weight: 700;
    font-family: 'Raleway', sans-serif;
    font-size: 0.9rem;
    margin-bottom: 0.6rem;
    color: var(--text-main);
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    background-color: #FFFFFF;
    border: 2px solid var(--border);
    border-radius: 8px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* Badges */
.badge {
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
}

.badge-pending {
    background: #fff3cd;
    color: #856404;
}

.badge-active {
    background: #d4edda;
    color: #155724;
}

.badge-error {
    background: #f8d7da;
    color: #721c24;
}

.badge-done {
    background: #cce5ff;
    color: #004085;
}

.badge-processing {
    background: #e1f5fe;
    color: #01579b;
}

/* Progress Bar */
.progress-container {
    width: 100%;
    background-color: var(--bg-light);
    border-radius: 10px;
    height: 8px;
    margin: 1rem 0;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #ff4757);
    width: 0%;
    transition: width 0.4s ease;
}

.progress-bar.animated {
    animation: progress-pulse 2s infinite linear;
    background-size: 200% 100%;
    background-image: linear-gradient(90deg, var(--primary) 0%, #ff4757 50%, var(--primary) 100%);
}

@keyframes progress-pulse {
    0% {
        background-position: 100% 0;
    }

    100% {
        background-position: -100% 0;
    }
}

.spin {
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

/* Job Cards specific */
.job-card {
    cursor: pointer;
    border-top: 4px solid var(--primary);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Responsive */
@media (max-width: 768px) {
    nav {
        height: auto;
        padding: 1.5rem;
        flex-direction: column;
        gap: 1rem;
    }

    .logo {
        font-size: 1.5rem;
    }

    #app {
        padding: 0 1rem 2rem 1rem;
    }
}

/* Custom Confirm Modal */
.modal-confirm {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: none;
    padding: 1.5rem;
    overflow-y: auto;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.25s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-confirm.active {
    display: flex;
}

#confirm-modal {
    z-index: 9999;
    /* Ensure it's above all other modals */
}

.modal-confirm-card {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 1rem;
    max-width: 400px;
    width: 100%;
    padding: 2rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.modal-confirm-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #ffffff;
}

.modal-confirm-desc {
    color: #a0a0a0;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.modal-confirm-actions {
    display: flex;
    gap: 1rem;
}

.modal-confirm-actions button {
    flex: 1;
}

/* Upload Modal & Dropzone */
.dropzone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 1.5rem 1rem;
    text-align: center;
    background: var(--bg-light);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dropzone:hover,
.dropzone.active {
    border-color: var(--primary);
    background: #fffafa;
}

.dropzone-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.dropzone p {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
}

.dropzone span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

#auth-form-container .card,
#upload-modal .card,
#job-modal .card {
    border-radius: 20px;
    padding: 2rem;
}