/* Modern Blue Archive Mod Loader CSS */
:root {
    /* Light theme colors */
    --primary-color: #2563eb;
    --primary-hover-color: #1d4ed8;
    --secondary-color: #64748b;
    --secondary-hover-color: #475569;
    --success-color: #16a34a;
    --success-hover-color: #15803d;
    --danger-color: #dc2626;
    --danger-hover-color: #b91c1c;
    --warning-color: #d97706;
    --warning-hover-color: #b45309;
    
    /* Surface colors */
    --background-color: #f8fafc;
    --surface-color: #ffffff;
    --card-bg: #ffffff;
    --hover-color: #f1f5f9;
    --border-color: #e2e8f0;
    --divider-color: #cbd5e1;
    
    /* Text colors */
    --text-color: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    /* Input colors */
    --input-bg: #ffffff;
    --input-border: #d1d5db;
    --input-focus: #3b82f6;
    
    /* Effects */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
}

/* Dark theme colors */
[data-theme="dark"] {
    --primary-color: #3b82f6;
    --primary-hover-color: #2563eb;
    --secondary-color: #6b7280;
    --secondary-hover-color: #9ca3af;
    --success-color: #22c55e;
    --success-hover-color: #16a34a;
    --danger-color: #ef4444;
    --danger-hover-color: #dc2626;
    --warning-color: #f59e0b;
    --warning-hover-color: #d97706;
    
    --background-color: #0f172a;
    --surface-color: #1e293b;
    --card-bg: #1e293b;
    --hover-color: #334155;
    --border-color: #334155;
    --divider-color: #475569;
    
    --text-color: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    --input-bg: #1e293b;
    --input-border: #475569;
    --input-focus: #3b82f6;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: var(--transition);
    min-height: 100vh;
}

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

/* Header */
.app-header {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
}

.app-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(37, 99, 235, 0.1);
}

.app-version {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--success-color));
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
}

#theme-toggle-btn {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 3.5rem;
    height: 3.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
}

#theme-toggle-btn:hover {
    background: var(--hover-color);
    transform: scale(1.1) rotate(10deg);
    box-shadow: var(--shadow-xl);
}

.theme-icon {
    transition: var(--transition);
}

/* Layout Grid */
.content-grid {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(0, 2.4fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 1rem;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

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

.card-header {
    padding: 1.5rem 1.5rem;
    border-bottom: 1px solid var(--divider-color);
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
    border: none;
    padding: 0;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

.card-content {
    padding: 0 1.5rem 1.5rem 1.5rem;
}

/* Game Info Card */
.game-info-card {
    height: fit-content;
}

.info-item {
    margin-bottom: 1rem;
}

.info-item label {
    display: block;
    font-size: 0.675rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.path-display {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.75rem;
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    color: var(--text-color);
    word-break: break-all;
    min-height: 2.5rem;
    display: flex;
    align-items: center;
}

.status-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--divider-color);
    display: flex;
    flex-direction: column; 
}

#status-message {
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 1rem;
    min-height: 1.2em;
}

/* Table */
.table-container {
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.mod-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface-color);
}

.mod-table th {
    background: var(--card-bg);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.675rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 0.75rem;
    text-align: left;
    border-bottom: 2px solid var(--divider-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.mod-table td {
    font-size: 0.8rem;
    padding: 0.875rem 0.75rem;
    border-bottom: 1px solid var(--divider-color);
    vertical-align: middle;
    transition: var(--transition);
}

.mod-table tbody tr {
    transition: var(--transition);
}

.mod-table tbody tr:hover {
    background: var(--hover-color);
}

.mod-table tbody tr:nth-child(even) {
    background: rgba(var(--text-color), 0.02);
}

/* Table column widths */
.col-checkbox { width: 60px; }
.col-filename { width: 460px; }
.col-modname { width: 450px; }
.col-character { width: 250px; }
.col-date { width: 140px; }
.col-actions { width: 80px; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    min-height: 2.5rem;
    padding: 0 1rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

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

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

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

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


.btn-success:hover:not(:disabled) {
    background: var(--success-hover-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

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

.btn-danger:hover:not(:disabled) {
    background: var(--danger-hover-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-large {
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
    min-height: 3rem;
}

.btn-icon {
    font-size: 1.1em;
}

/* Form elements */
.mod-name-input {
    width: 100%;
    background: var(--input-bg);
    border: 2px solid var(--input-border);
    border-radius: 0.5rem;
    padding: 0.5rem;
    font-family: inherit;
    font-size: 0.8rem;
    color: var(--text-color);
    transition: var(--transition);
}

.mod-name-input:focus {
    outline: none;
    border-color: var(--input-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Checkboxes */
input[type="checkbox"] {
    appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: 0.25rem;
    background: var(--input-bg);
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

input[type="checkbox"]:checked {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

input[type="checkbox"]:checked::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.875rem;
    font-weight: bold;
}

input[type="checkbox"]:hover {
    border-color: var(--primary-color);
}

/* Action Panel */
.action-panel {
    display: flex;
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 1.5rem;
    gap: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.status-display {
    text-align: center;
}

#action-status {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1rem;
    min-height: 1.5em;
    margin: 0;
}

/* Delete button */
.delete-btn {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-btn:hover {
    background: rgba(var(--danger-color), 0.1);
    transform: scale(1.1);
}

/* Conflict styling */
.conflict-warning {
    background: linear-gradient(135deg, rgba(var(--warning-color), 0.1), rgba(var(--danger-color), 0.1));
    border: 1px solid var(--warning-color);
    color: var(--warning-color);
    font-weight: 600;
    border-radius: 0.5rem;
}

.conflict-filename {
    color: var(--danger-color) !important;
    font-weight: 600;
    position: relative;
}

.conflict-filename::after {
    content: "⚠️";
    margin-left: 0.5rem;
    font-size: 0.75rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .app-title {
        font-size: 2rem;
    }
    
    .theme-toggle {
        top: 1rem;
        right: 1rem;
    }
    
    #theme-toggle-btn {
        width: 3rem;
        height: 3rem;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .header-actions {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .mod-table {
        font-size: 0.8rem;
    }
    
    .col-filename { width: 150px; }
    .col-date { width: 100px; }
}

/* Loading states */
.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.2),
        transparent
    );
    animation: loading 1.5s infinite;
}

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

/* Smooth transitions for all theme changes */
*,
*::before,
*::after {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}