/* * ==========================================================================
 * HIGH-END DARK MODE DESIGN SYSTEM - PURE CSS
 * ==========================================================================
 */

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

:root {
    color-scheme: dark;
    
    /* OLED-Friendly Deep Backgrounds */
    --bg-base: #0a0a0a;
    --bg-surface: #121212;
    --bg-surface-hover: #1a1a1a;
    --bg-surface-raised: #222222;

    /* Ultra-subtle borders */
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(255, 255, 255, 0.2);

    /* Electric Accents */
    --accent-primary: #6366f1; /* Deep Indigo */
    --accent-hover: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.25);
    
    /* Functional Colors */
    --text-primary: #ededed;
    --text-secondary: #a1a1aa;
    --text-tertiary: #71717a;
    
    --status-success: #10b981;
    --status-success-bg: rgba(16, 185, 129, 0.1);
    --status-danger: #ef4444;
    --status-danger-bg: rgba(239, 68, 68, 0.1);

    /* Fluid Typography & Spacing */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* =========================================
   GLOBAL RESET & TYPOGRAPHY
   ========================================= */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Sleek Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { 
    background: var(--bg-surface-raised); 
    border-radius: var(--radius-sm); 
}
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: clamp(1.5rem, 4vw, 3rem);
}

h1, h2, h3 { 
    color: #ffffff; 
    font-weight: 600; 
    letter-spacing: -0.03em; 
}

/* =========================================
   LOGIN CARD (Premium Focus)
   ========================================= */
.login-card {
    width: 100%;
    max-width: 380px;
    margin: auto;
    margin-top: 15vh;
    background: var(--bg-surface);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    box-shadow: 0 20px 40px -15px rgba(0,0,0,0.8), 
                inset 0 1px 0 rgba(255,255,255,0.05);
    position: relative;
    backdrop-filter: blur(20px);
}

.login-card h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.5rem;
}

/* =========================================
   FORM ELEMENTS (Micro-interactions)
   ========================================= */
label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    margin-top: 1.25rem;
}

input {
    width: 100%;
    background: var(--bg-base);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition-fast);
    outline: none;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.2);
}

input:hover {
    border-color: var(--border-focus);
}

input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow), inset 0 1px 2px rgba(0,0,0,0.2);
    background: var(--bg-surface);
}

input[readonly] {
    background: var(--bg-surface-raised);
    color: var(--status-success);
    font-family: 'Fira Code', monospace;
    font-weight: 600;
    border-style: dashed;
    cursor: not-allowed;
    opacity: 0.8;
}

/* =========================================
   BUTTONS (Magnetic & Tactile)
   ========================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition-fast);
    user-select: none;
    white-space: nowrap;
}

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

.btn-primary {
    background: var(--accent-primary);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.2), inset 0 1px 0 rgba(255,255,255,0.15);
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-danger {
    background: transparent;
    color: var(--status-danger);
    border-color: var(--border-subtle);
}

.btn-danger:hover {
    background: var(--status-danger-bg);
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-success {
    background: var(--bg-surface-raised);
    color: var(--status-success);
    border-color: var(--border-subtle);
}

.btn-success:hover {
    background: var(--status-success-bg);
    border-color: rgba(16, 185, 129, 0.3);
}

/* =========================================
   LAYOUT & HEADER
   ========================================= */
.header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    max-width: 450px;
    position: relative;
}

.search-box input {
    border-radius: 2rem; /* Pill shape for search */
    padding-left: 1.5rem;
    background: var(--bg-surface);
}

/* =========================================
   DATA TABLE (Enterprise Grade)
   ========================================= */
.table-wrapper {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow-x: auto;
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5);
}

table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

th, td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
}

th {
    background: rgba(255, 255, 255, 0.02);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(10px);
}

td {
    font-size: 0.9rem;
    transition: background var(--transition-fast);
}

/* Monospace for Numbers/Prices */
td:nth-child(1), td:nth-child(3), td:nth-child(4), td:nth-child(5) {
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
}

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

tr:hover td {
    background: var(--bg-surface-hover);
}

td[style*="color: var(--success)"] {
    color: var(--status-success) !important;
    font-weight: 500;
}

/* =========================================
   MODAL (Glassmorphism & Physics)
   ========================================= */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 1rem;
    align-items: center; /* Flexbox center fallback */
    justify-content: center;
}

/* Javascript tarafında modal açılırken display:flex yaparsan animasyon mükemmel çalışır */
.modal[style*="display: block"] {
    display: flex !important;
    animation: modalBackdropFade var(--transition-smooth) forwards;
}

.modal-content {
    background: var(--bg-surface);
    width: 100%;
    max-width: 480px;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7),
                inset 0 1px 0 rgba(255,255,255,0.05);
    transform: scale(0.95) translateY(10px);
    opacity: 0;
    animation: modalSlideUp var(--transition-smooth) forwards;
    animation-delay: 50ms; /* Slight delay for physics feel */
}

.modal-content h2 { margin-bottom: 0.5rem; }

/* Form Action Buttons in Modal */
.modal-content div[style*="display:flex"] {
    margin-top: 2rem;
    gap: 1rem !important;
}

/* =========================================
   ANIMATIONS
   ========================================= */
@keyframes modalBackdropFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideUp {
    to { 
        opacity: 1; 
        transform: scale(1) translateY(0); 
    }
}

/* =========================================
   MOBILE RESPONSIVENESS
   ========================================= */
@media (max-width: 768px) {
    .header-actions { flex-direction: column; align-items: stretch; }
    .search-box { max-width: 100%; }
    .login-card { padding: 1.5rem; margin-top: 5vh; }
    .modal-content { padding: 1.5rem; }
    th, td { padding: 0.75rem 1rem; }
}