/* SPDX-License-Identifier: MIT */

/* IronDrop Base Styles - Common Design System */
/* Professional Blackish Grey Design */

/* CSS Variables - Design Tokens */
:root {
    /* Colors */
    --bg-primary: #0a0a0a;
    /* Deep black */
    --bg-secondary: #1a1a1a;
    /* Dark grey */
    --bg-tertiary: #2a2a2a;
    /* Medium grey */
    --bg-glass: rgba(26, 26, 26, 0.4);
    --text-primary: #e5e5e5;
    /* Light grey */
    --text-secondary: #b0b0b0;
    /* Medium grey text */
    --text-accent: #ffffff;
    /* Pure white accent */
    --text-muted: #666666;
    /* Muted grey */
    --border: rgba(64, 64, 64, 0.4);
    --hover-bg: rgba(255, 255, 255, 0.08);
    --table-header: #333333;
    /* Dark header grey */
    --table-stripe: rgba(255, 255, 255, 0.03);
    --table-border: rgba(64, 64, 64, 0.5);
    --link-hover: #ffffff;
    /* Pure white on hover */

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    --gradient-accent: linear-gradient(135deg, var(--text-accent), #cccccc);

    /* Shadows - Unified System */
    --shadow-minimal: 0 1px 2px rgba(0, 0, 0, 0.02);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-button: 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.03);
    
    /* Enhanced shadows from directory styles */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 25px 35px -5px rgba(0, 0, 0, 0.8), 0 15px 15px -5px rgba(0, 0, 0, 0.5);
    --shadow-inset: inset 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-focus: 0 0 0 3px rgba(96, 165, 250, 0.3);

    /* Additional solid color variables */
    --border-hover: #555555;
    
    /* Enhanced design tokens from directory styles */
    --gradient: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    --table-header: #333333;         /* Dark header grey */
    --table-stripe: rgba(255, 255, 255, 0.03);
    --table-border: rgba(64, 64, 64, 0.5);
    --link-hover: #ffffff;           /* Pure white on hover */

    /* Typography - Unified System */
    --font-family: 'Fira Code', 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* Typography aliases for compatibility */
    --font-family-primary: var(--font-body);
    --font-family-mono: var(--font-family);
    
    /* Font sizes - unified system */
    --font-size-xs: 0.65rem;         /* 10px - Very small text */
    --font-size-sm: 0.7rem;          /* 11px - Small text */
    --font-size-base: 0.8rem;        /* 13px - Base small text */
    --font-size-md: 0.875rem;        /* 14px - Medium text */
    --font-size-lg: 0.95rem;         /* 15px - Large text */
    --font-size-xl: 1rem;            /* 16px - Extra large text */
    
    /* Font weights */
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    /* Line heights */
    --line-height-tight: 1.2;
    --line-height-normal: 1.6;
    
    /* Letter spacing */
    --letter-spacing-tight: -0.025em;
    --letter-spacing-normal: 0;
    --letter-spacing-wide: 0.05em;
    --letter-spacing-wider: 0.1em;

    /* Spacing - Unified with directory styles */
    --space-xs: 0.25rem;            /* 4px - Very small gaps */
    --space-sm: 0.5rem;             /* 8px - Small gaps */
    --space-md: 0.75rem;            /* 12px - Medium gaps (unified) */
    --space-lg: 1rem;               /* 16px - Large gaps */
    --space-xl: 1.5rem;             /* 24px - Extra large gaps */
    --space-2xl: 2rem;              /* 32px - Double extra large gaps */
    --space-3xl: 2.5rem;            /* 40px - Triple extra large gaps */

    /* Legacy spacing aliases for backward compatibility */
    --spacing-xs: var(--space-xs);
    --spacing-sm: var(--space-sm);
    --spacing-md: var(--space-md);
    --spacing-lg: var(--space-lg);
    --spacing-xl: var(--space-xl);
    --spacing-2xl: var(--space-2xl);
    --spacing-3xl: var(--space-3xl);

    /* Border Radius - Unified system */
    --radius-sm: 6px;               /* Small elements (marks, badges) */
    --radius-md: 12px;              /* Medium elements (buttons, inputs) */
    --radius-lg: 16px;              /* Large elements (cards, dropdowns) */
    --radius-xl: 24px;              /* Extra large elements (main containers) */
    
    /* Legacy radius aliases */
    --radius-small: var(--radius-sm);
    --radius-medium: var(--radius-md);
    --radius-large: var(--radius-lg);
    --radius-xlarge: var(--radius-xl);
    --radius-round: 50%;

    /* Transitions - Unified System */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-subtle: 0.1s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* Z-index system */
    --z-background: -1;
    --z-base: 1;
    --z-elevated: 10;
    --z-modal: 100;
    --z-dropdown: 1000;
    --z-top: 9999;
}

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

/* Base Typography */
body {
    font-family: var(--font-body);
    background: var(--bg-secondary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    transition: var(--transition-smooth);
}

/* Global background gradient */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-primary);
    opacity: 0.03;
    z-index: -1;
}

/* Common Layout Components */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-xl);
}

/* Header Components */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border);
}

.app-logo {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    text-decoration: none;
    color: var(--text-primary);
}

.logo-img {
    height: 120px;
    width: auto;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

.logo-text {
    font-family: var(--font-family);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-accent);
    text-shadow: 0 2px 4px rgba(255, 255, 255, 0.1);
}

.header-actions {
    display: flex;
    gap: var(--space-md);
    align-items: center;
}

/* Page Headers */
.page-header {
    margin-bottom: var(--space-xl);
    text-align: center;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-accent);
    margin-bottom: var(--space-sm);
    background: var(--gradient-accent);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin: 0;
}

/* Breadcrumb Navigation */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    font-size: 0.9rem;
}

.breadcrumb-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-fast);
}

.breadcrumb-link:hover {
    color: var(--text-primary);
}

.breadcrumb-separator {
    color: var(--text-muted);
}

/* Common Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.9rem;
    text-decoration: none;
    transition: var(--transition-fast);
    cursor: pointer;
    border: none;
    backdrop-filter: blur(10px);
}

/* Light Button (improved styling with dark shadows) */
.btn-light {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.btn-light:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: var(--gradient-accent);
    color: var(--bg-primary);
    box-shadow: var(--shadow-button);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background: var(--bg-glass);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-card);
}

/* Icon Buttons */
.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
}

/* Card Components - Updated to maintain upload card aesthetic */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    /* Keep the nice rounded corners like upload */
    padding: var(--space-lg);
    box-shadow: var(--shadow-minimal);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow);
    border-color: var(--border-hover);
    transform: translateY(-1px);
    /* Subtle lift */
}

.card-header {
    padding: var(--space-lg) var(--space-lg) var(--space-md);
    border-bottom: 1px solid var(--border);
    background: transparent;
    /* Remove background for cleaner look */
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.card-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: var(--space-xs) 0 0 0;
}

.card-content {
    padding: var(--space-lg);
    color: var(--text-primary);
}

.card-footer {
    padding: var(--space-md) var(--space-lg) var(--space-lg);
    border-top: 1px solid var(--border);
    background: transparent;
    /* Remove background for cleaner look */
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
}

/* Simple card variant (no padding adjustments) */
.card-simple {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow-minimal);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.card-simple:hover {
    box-shadow: var(--shadow);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

/* Form Components */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: var(--space-sm);
    font-weight: 500;
}

.form-input {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--text-accent);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

/* Table Styles - Updated with minimal shadows */
.table-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    /* Match card radius */
    overflow: hidden;
    box-shadow: var(--shadow-minimal);
    transition: var(--transition-smooth);
}

.table-container:hover {
    box-shadow: var(--shadow);
    border-color: var(--border-hover);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background: var(--table-header);
    color: var(--text-primary);
    padding: 1.8rem 2.5rem;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    position: relative;
    border-right: 1px solid var(--table-border);
    /* Thinner border */
    box-shadow: inset 0 -1px 0 var(--border);
}

.table th:last-child {
    border-right: none;
}

.table th::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    /* Thinner accent line */
    background: linear-gradient(90deg, transparent, var(--text-accent), transparent);
    opacity: 0.3;
    /* More subtle */
}

.table td {
    padding: 1.5rem 2.5rem;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--table-border);
    transition: var(--transition-smooth);
    vertical-align: middle;
}

.table td:last-child {
    border-right: none;
}

.table tbody tr:nth-child(even) {
    background: var(--table-stripe);
}

.table tbody tr:hover td {
    background: var(--hover-bg);
    transform: translateY(-1px);
    /* More subtle */
    box-shadow: var(--shadow-minimal);
    /* Minimal shadow */
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Footer - Consistent with design system */
.app-footer {
    margin-top: var(--space-2xl);
    padding: var(--space-xl) var(--space-lg);
    border-top: 1px solid var(--border);
    text-align: center;
    background: var(--bg-secondary);
    border-radius: 20px 20px 0 0;
    /* Match card styling */
    box-shadow: var(--shadow-minimal);
}

.footer-info {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-family: var(--font-family);
    opacity: 0.7;
    transition: var(--transition-fast);
}

.app-footer:hover .footer-info {
    opacity: 1;
    color: var(--text-secondary);
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-xs {
    gap: var(--space-xs);
}

.gap-sm {
    gap: var(--space-sm);
}

.gap-md {
    gap: var(--space-md);
}

.gap-lg {
    gap: var(--space-lg);
}

.mb-0 {
    margin-bottom: 0;
}

.mb-sm {
    margin-bottom: var(--space-sm);
}

.mb-md {
    margin-bottom: var(--space-md);
}

.mb-lg {
    margin-bottom: var(--space-lg);
}

.mb-xl {
    margin-bottom: var(--space-xl);
}

.mt-0 {
    margin-top: 0;
}

.mt-sm {
    margin-top: var(--space-sm);
}

.mt-md {
    margin-top: var(--space-md);
}

.mt-lg {
    margin-top: var(--space-lg);
}

.mt-xl {
    margin-top: var(--space-xl);
}

.hidden {
    display: none;
}

.block {
    display: block;
}

.inline-block {
    display: inline-block;
}

/* Loading States */
.loading {
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

/* Animation Keyframes */
@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .container {
        padding: var(--space-md);
    }

    .app-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md);
        margin-bottom: var(--space-lg);
    }

    .page-title {
        font-size: 2rem;
        margin-bottom: 0.25rem;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.875rem;
    }

    .table th,
    .table td {
        padding: var(--space-md) var(--space-lg);
    }

    .app-footer {
        margin-top: var(--space-xl);
        padding-top: var(--space-lg);
    }
}

@media (max-width: 480px) {
    .container {
        padding: var(--space-md);
    }

    .page-header {
        margin-bottom: var(--space-lg);
    }

    .app-footer {
        margin-top: var(--space-xl);
        padding-top: var(--space-lg);
    }
}