/* style.css - Modern Professional Design */
:root {
    /* Color Palette - Professional Blue & Slate */
    --primary: #2563eb;       /* Modern Blue */
    --primary-dark: #1d4ed8;  /* Darker Blue */
    --primary-light: #eff6ff; /* Light Blue Background */
    
    --text-main: #1e293b;     /* Slate 800 */
    --text-muted: #64748b;    /* Slate 500 */
    
    --bg-body: #f8fafc;       /* Slate 50 */
    --bg-card: #ffffff;
    
    --border-color: #e2e8f0;  /* Slate 200 */
    
    --danger: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b; /* Amber 500 */
    
    /* Spacing & Layout */
    --container-width: 1000px;
    --border-radius: 8px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

/* Layout */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.main-content {
    flex: 1;
    padding: 3rem 0;
    width: 100%;
}

/* Navbar */
.navbar {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar .logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links .btn-register {
    background-color: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
}

.nav-links .btn-register:hover {
    background-color: var(--primary-dark);
    color: white;
}

/* Typography */
h1, h2, h3 {
    color: var(--text-main);
    font-weight: 700;
    line-height: 1.2;
}

p {
    color: var(--text-muted);
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    padding: 2rem;
    margin-bottom: 2rem;
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

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

.card-header h2 {
    font-size: 1.5rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #fff;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

textarea.form-control {
    min-height: 350px;
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    resize: vertical;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    gap: 0.5rem;
}

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

.btn:active {
    transform: translateY(0);
}

.btn-block {
    display: flex;
    width: 100%;
}

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

.btn-secondary:hover {
    background-color: var(--bg-body);
    border-color: #cbd5e1;
}

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

.btn-warning:hover {
    background-color: #d97706; /* Darker amber */
}

/* Paste View */
.paste-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.paste-content {
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    overflow-x: auto;
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    font-size: 0.9rem;
    color: var(--text-main);
    line-height: 1.7;
    white-space: pre-wrap;
}

/* Auth Pages */
.auth-form {
    max-width: 450px;
    margin: 2rem auto;
}

.auth-form .card {
    padding: 2.5rem;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
    font-weight: 600;
}

/* Dashboard Table */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.table th {
    background-color: #f1f5f9;
    font-weight: 600;
    color: var(--text-muted);
    text-align: left;
    padding: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

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

.table tr:hover td {
    background-color: #f8fafc;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-error {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background-color: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* Footer */
.footer {
    background-color: white;
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: auto;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Component Classes */
.action-buttons {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-group-text {
    color: var(--text-muted);
    font-size: 0.9em;
    white-space: nowrap;
}

.input-group-field {
    /* Inherit default form-control styles */
}

.editor-toggle-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.toggle-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

/* Table Actions */
.table-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }

    .nav-links li {
        text-align: center;
    }
    
    .card {
        padding: 1.25rem;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .paste-meta {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    /* Action Buttons (view.php) */
    .action-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .action-buttons .btn {
        width: 100%;
    }

    /* Editor toggle buttons (index.php) */
    .editor-toggle-group {
        flex-direction: column;
        gap: 0.5rem;
    }

    .toggle-option {
        width: 100%;
        justify-content: center;
        /* Restore button look for mobile */
        background: #f1f5f9;
        padding: 0.5rem 1rem;
        border-radius: 6px;
        border: 1px solid var(--border-color);
    }

    /* Custom slug input */
    .slug-group {
        flex-wrap: wrap;
    }
    
    .slug-group .input-group-text {
        width: 100%;
        margin-bottom: 0.25rem;
    }

    /* Table Actions */
    .table-actions {
        flex-direction: column;
    }

    /* Footer spacing on mobile */
    .footer {
        padding: 2.75rem 0;
        margin-top: 1.5rem;
    }
}

@media (max-width: 480px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    .paste-meta {
        font-size: 0.75rem;
    }
}
