/* style.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    /* Theme Light (Default) */
    --bg-app: #f8fafc;
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #e0e7ff;
    --primary-rgb: 79, 70, 229;
    --border: #e2e8f0;
    --border-hover: #cbd5e1;
    --success: #10b981;
    --success-light: #d1fae5;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --warning: #f59e0b;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.08);
    --shadow-premium: 0 20px 25px -5px rgba(79, 70, 229, 0.04), 0 8px 10px -6px rgba(79, 70, 229, 0.04);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    --transition-speed: 0.25s;
    --container-max: 1200px;
}

body.dark-theme {
    /* Theme Dark */
    --bg-app: #0b0f19;
    --bg-card: #151d30;
    --bg-input: #0b0f19;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #818cf8;
    --primary-hover: #6366f1;
    --primary-light: rgba(129, 140, 248, 0.15);
    --primary-rgb: 129, 140, 248;
    --border: #223049;
    --border-hover: #2e3e5d;
    --success: #34d399;
    --success-light: rgba(52, 211, 153, 0.15);
    --danger: #f87171;
    --danger-light: rgba(248, 113, 113, 0.15);
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
    --shadow-premium: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
}

/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-app);
    color: var(--text-main);
    line-height: 1.5;
    padding-bottom: 3rem;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-speed);
}
a:hover {
    color: var(--primary-hover);
}

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

/* Header & Navigation */
header {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 0;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background-color: rgba(var(--primary-rgb), 0.02);
}

body.dark-theme header {
    background-color: rgba(21, 29, 48, 0.85);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary) 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    cursor: pointer;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Theme Toggle Button */
.btn-theme {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-main);
    cursor: pointer;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed);
}
.btn-theme:hover {
    border-color: var(--primary);
    background-color: var(--primary-light);
    color: var(--primary);
}

/* Standard Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-body);
    font-weight: 600;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-speed);
    font-size: 0.9rem;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.25);
}

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

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

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

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 0 3rem;
    max-width: 700px;
    margin: 0 auto;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero h2 {
    font-size: 2.75rem;
    line-height: 1.2;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.hero p {
    color: var(--text-muted);
    font-size: 1.125rem;
    margin-bottom: 2rem;
}

/* Card layout */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-premium);
    overflow: hidden;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

/* Table Design */
.table-responsive {
    overflow-x: auto;
    margin-top: 1.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    padding: 1rem;
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}

tr {
    transition: background-color var(--transition-speed);
}

tr:hover td {
    background-color: rgba(var(--primary-rgb), 0.02);
}

/* Bookmarks List UI */
.bookmark-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.bookmark-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-speed);
}

.bookmark-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.bookmark-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow: hidden;
    padding-right: 1rem;
}

.bookmark-title {
    font-weight: 600;
    color: var(--text-main);
    font-size: 1.05rem;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.bookmark-url {
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.bookmark-url svg {
    flex-shrink: 0;
}

.bookmark-item:hover .bookmark-title {
    color: var(--primary);
}

/* Search Bar */
.search-container {
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.05s both;
}

.search-input-wrapper {
    position: relative;
    flex-grow: 1;
}

.search-input-wrapper svg {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    background-color: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    transition: all var(--transition-speed);
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

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

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

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    transition: all var(--transition-speed);
}

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

textarea.form-control {
    resize: vertical;
    min-height: 120px;
    font-family: monospace;
    font-size: 0.9rem;
}

/* Login Card Spec */
.login-wrapper {
    max-width: 420px;
    margin: 6rem auto 0;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* Alert Banners */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideInDown 0.4s ease-out;
}

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

.alert-danger {
    background-color: var(--danger-light);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.35rem;
    margin-top: 3rem;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

.pagination-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background-color: var(--bg-card);
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition-speed);
    cursor: pointer;
}

.pagination-item:hover:not(.disabled):not(.active) {
    border-color: var(--primary);
    color: var(--primary);
    background-color: var(--primary-light);
    transform: translateY(-1px);
}

.pagination-item.active {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 3px 8px rgba(var(--primary-rgb), 0.2);
}

.pagination-item.disabled {
    color: var(--text-muted);
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-dots {
    color: var(--text-muted);
    padding: 0 0.25rem;
}

/* Admin Grid Dashboard */
.admin-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

@media (max-width: 992px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }
}

.admin-sidebar {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    height: fit-content;
    box-shadow: var(--shadow-sm);
}

.admin-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.admin-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-weight: 500;
    transition: all var(--transition-speed);
}

.admin-menu-item:hover, .admin-menu-item.active {
    background-color: var(--primary-light);
    color: var(--primary);
}

/* Actions cell alignment */
.actions-cell {
    display: flex;
    gap: 0.5rem;
}

/* Modal dialog */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.25s ease-out;
}

body.dark-theme .modal-backdrop {
    background-color: rgba(11, 15, 25, 0.8);
}

.modal-dialog {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}
.modal-close:hover {
    color: var(--text-main);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* CSS Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleUp {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Empty State Styling */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}
.empty-state svg {
    margin-bottom: 1rem;
    color: var(--border);
}
.empty-state h3 {
    font-size: 1.25rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}
