/* Reset & Base Setup */
:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --success: #10b981;
    --error: #ef4444;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    background-image:
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.15) 0px, transparent 50%);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 2rem;
    line-height: 1.6;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 0.5rem;
}

header h1 span {
    color: var(--accent);
}

header p {
    color: var(--text-secondary);
    font-weight: 300;
    font-size: 1.1rem;
}

/* CSS Grid Container */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Card Styling (Glassmorphism & Micro-animations) */
.module-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 1rem;
    padding: 2rem;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.module-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
    z-index: 10;
}

.icon-wrapper {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent);
    padding: 1rem;
    border-radius: 50%;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.module-card h2 {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.module-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 300;
    margin-bottom: 1.5rem;
}

/* Status Component Styling */
.status-container {
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: auto;
}

/* Tooltip Image Preview */
.has-tooltip {
    position: relative;
    cursor: help;
}

.tooltip-content {
    position: absolute;
    top: 120%;
    /* Position below the icon */
    left: 50%;
    transform: translateX(-50%);
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    background: rgba(10, 10, 15, 0.95);
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
    z-index: 100;
    width: 600px;
    /* Made larger as requested */
    max-width: 90vw;
    /* Keep responsive bounds */
    pointer-events: none;
    /* Let hover persist on icon */
}

/* Add a small arrow pointing up */
.tooltip-content::after {
    content: '';
    position: absolute;
    bottom: 100%;
    /* Pointing up to the icon from the tooltip */
    left: 50%;
    margin-left: -8px;
    border-width: 8px;
    border-style: solid;
    border-color: transparent transparent rgba(10, 10, 15, 0.95) transparent;
}

.has-tooltip:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(5px);
}

.tooltip-content img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.status {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    width: 100%;
    animation: fadeIn 0.3s ease-in-out;
}

.status.pending {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

.status.processing {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.status.complete {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status.complete p {
    margin-bottom: 0.5rem;
    color: var(--success);
}

.status.failed {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Form Styles */
.upload-form {
    width: 100%;
    text-align: left;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.form-select:focus {
    border-color: var(--accent);
}

.checkbox-group {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-group label {
    margin-bottom: 0;
    text-transform: none;
    letter-spacing: normal;
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
}

.form-checkbox {
    width: 1rem;
    height: 1rem;
    accent-color: var(--accent);
    cursor: pointer;
}

.file-upload-btn {
    display: block;
    text-align: center;
    margin-top: 0.5rem;
    width: 100%;
    box-sizing: border-box;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border-radius: 0.5rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.1s ease;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: inherit;
}

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

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

.btn:active {
    transform: scale(0.97);
}

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

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

/* Micro-animation for loading pulse */
.status.processing {
    position: relative;
    overflow: hidden;
}

.status.processing::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: loading-pulse 1.5s infinite ease-in-out;
}

@keyframes loading-pulse {
    100% {
        left: 200%;
    }
}

/* Responsive adjustments */
@media (max-width: 600px) {
    body {
        padding: 1rem;
    }

    header h1 {
        font-size: 2rem;
    }
}

/* Progress Bar */
.progress-bar-bg {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    margin-top: 12px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px var(--accent);
}
