﻿/* ============================================
   URL Redirect Manager – Admin Stylesheet
   Modern Premium Dark Theme with Glassmorphism
   ============================================ */

:root {
    /* Backgrounds */
    --bg-dark: #0b0f19;
    --bg-sidebar: rgba(11, 15, 25, 0.85);
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-input: rgba(255, 255, 255, 0.04);

    /* Borders */
    --border: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.15);

    /* Text */
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;

    /* Accents */
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --accent-light: rgba(59, 130, 246, 0.15);
    --accent-glow: rgba(59, 130, 246, 0.4);

    /* Status Colors */
    --green: #10b981;
    --green-bg: rgba(16, 185, 129, 0.15);
    --green-glow: rgba(16, 185, 129, 0.4);

    --red: #ef4444;
    --red-bg: rgba(239, 68, 68, 0.15);
    --red-glow: rgba(239, 68, 68, 0.4);

    --amber: #f59e0b;
    --amber-bg: rgba(245, 158, 11, 0.15);

    --blue: #3b82f6;
    --blue-bg: rgba(59, 130, 246, 0.15);

    --cyan: #06b6d4;
    --cyan-bg: rgba(6, 182, 212, 0.15);

    --purple: #8b5cf6;
    --purple-bg: rgba(139, 92, 246, 0.15);
    --gray-bg: rgba(100, 116, 139, 0.15);

    /* Shapes & Elevation */
    --radius: 12px;
    --radius-lg: 20px;
    --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-dark);
    background-image:
        radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.1), transparent 30%),
        radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.1), transparent 30%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

h1,
h2,
h3,
h4,
h5,
h6,
.stat-value {
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.01em;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--accent-hover);
    text-shadow: 0 0 10px var(--accent-glow);
}

/* ========================
   Sidebar
   ======================== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: var(--bg-sidebar);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1.75rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    color: #ffffff;
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-brand svg {
    color: var(--accent);
    -webkit-text-fill-color: var(--accent);
    flex-shrink: 0;
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all var(--transition);
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(4px);
}

.nav-link.active {
    color: #ffffff;
    background: var(--accent-light);
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.1) inset;
}

.nav-link.active svg {
    color: var(--accent-hover);
    filter: drop-shadow(0 0 4px var(--accent-glow));
}

.nav-link svg {
    flex-shrink: 0;
    transition: all var(--transition);
}

.sidebar-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
}

.sidebar-user svg {
    color: var(--text-muted);
}

/* ========================
   Main Content Area
   ======================== */
.main-content {
    margin-left: 260px;
    padding: 2.5rem 3rem;
    min-height: 100vh;
    animation: fadeUp 0.6s ease-out forwards;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 2.5rem;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 0.25rem;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ========================
   Stats Grid
   ======================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
}

.stat-card:hover {
    border-color: var(--border-light);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    background: rgba(255, 255, 255, 0.05);
}

.stat-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon-blue {
    background: var(--blue-bg);
    color: var(--blue);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}

.stat-icon-green {
    background: var(--green-bg);
    color: var(--green);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

.stat-icon-amber {
    background: var(--amber-bg);
    color: var(--amber);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.2);
}

.stat-icon-purple {
    background: var(--purple-bg);
    color: var(--purple);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.1;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

/* ========================
   Cards
   ======================== */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.01);
}

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

.card-body {
    padding: 2rem;
}

/* ========================
   Table
   ======================== */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: rgba(0, 0, 0, 0.2);
}

th {
    text-align: left;
    padding: 1rem 1.5rem;
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    white-space: nowrap;
}

td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
    vertical-align: middle;
}

tbody tr {
    transition: background var(--transition);
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

tbody tr:last-child td {
    border-bottom: none;
}

.url-code {
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: 'ui-monospace', 'SFMono-Regular', Menlo, Monaco, Consolas, monospace;
    border: 1px solid rgba(255, 255, 255, 0.05);
    white-space: nowrap;
    transition: border-color var(--transition);
}

tbody tr:hover .url-code {
    border-color: rgba(255, 255, 255, 0.15);
}

.url-cell {
    max-width: 250px;
}

.url-text {
    display: inline-block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--accent);
    font-weight: 500;
}

.url-text:hover {
    color: var(--accent-hover);
    text-shadow: 0 0 10px var(--accent-glow);
}

.text-muted {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ========================
   Badges
   ======================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: 'Inter', sans-serif;
}

.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.badge-green {
    background: var(--green-bg);
    color: var(--green);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-green::before {
    background: var(--green);
    box-shadow: 0 0 8px var(--green-glow);
}

.badge-gray {
    background: var(--gray-bg);
    color: var(--text-muted);
    border: 1px solid rgba(100, 116, 139, 0.2);
}

.badge-gray::before {
    background: var(--text-muted);
}

.badge-blue {
    background: var(--blue-bg);
    color: var(--blue);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-blue::before {
    background: var(--blue);
    box-shadow: 0 0 8px var(--accent-glow);
}

.badge-cyan {
    background: var(--cyan-bg);
    color: var(--cyan);
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.badge-cyan::before {
    background: var(--cyan);
    box-shadow: 0 0 8px rgba(6, 182, 212, 0.4);
}

/* ========================
   Buttons
   ======================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.6rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    line-height: 1.5;
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--accent);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px var(--accent-light);
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: #ffffff;
    box-shadow: 0 6px 20px var(--accent-glow);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-light);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
}

.btn-outline:hover {
    color: #ffffff;
    border-color: var(--border-light);
    background: rgba(255, 255, 255, 0.03);
}

.btn-danger-outline {
    background: transparent;
    color: var(--red);
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger-outline:hover {
    background: var(--red-bg);
    border-color: var(--red);
    color: #fff;
    box-shadow: 0 0 15px var(--red-glow);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 8px;
}

.btn-full {
    width: 100%;
    justify-content: center;
    padding: 0.8rem;
}

/* ========================
   Forms
   ======================== */
.form-group {
    margin-bottom: 1.5rem;
    flex: 1;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.required {
    color: var(--red);
}

.form-hint {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

input[type=text],
input[type=password],
input[type=email],
select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: #ffffff;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all var(--transition);
}

input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

input:focus,
select:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 3rem;
    cursor: pointer;
}

select option {
    background: #0b0f19;
    color: #ffffff;
}

.form-row {
    display: flex;
    gap: 1.5rem;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

/* ========================
   Search
   ======================== */
.search-form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrap svg {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    pointer-events: none;
    width: 16px;
    height: 16px;
}

.search-input-wrap input {
    padding-left: 40px;
    width: 300px;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
    border-radius: 9999px;
}

/* ========================
   Action Buttons (table)
   ======================== */
.action-btns {
    display: flex;
    gap: 6px;
}

.inline-form {
    display: inline;
}

/* ========================
   Alerts
   ======================== */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert ul {
    margin: 0;
    padding-left: 1.2rem;
}

.alert-success {
    background: var(--green-bg);
    color: var(--green);
    border-color: var(--green);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.1);
}

.alert-danger {
    background: var(--red-bg);
    color: var(--red);
    border-color: var(--red);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.1);
}

/* ========================
   Empty State
   ======================== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state svg {
    margin: 0 auto 1.5rem auto;
    color: var(--text-muted);
    opacity: 0.5;
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    border-radius: 24px;
    width: 80px;
    height: 80px;
}

.empty-state p {
    font-size: 1.05rem;
    color: var(--text-secondary);
}

/* ========================
   Login Page
   ======================== */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
    background: var(--bg-dark);
    background-image:
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.15), transparent 25%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 3rem 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
    animation: fadeUp 0.6s ease-out forwards;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: var(--accent-light);
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
}

.login-icon svg {
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.login-footer {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.login-footer strong {
    color: var(--text-secondary);
}

/* ========================
   Responsive
   ======================== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .main-content {
        margin-left: 0;
        padding: 2rem 1.5rem;
    }

    /* Show a mobile menu button area */
    .main-content::before {
        content: '☰ Menu';
        display: inline-flex;
        align-items: center;
        padding: 0.5rem 1rem;
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        color: var(--text-primary);
        font-size: 0.9rem;
        font-weight: 500;
        cursor: pointer;
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        gap: 1.25rem;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .search-input-wrap input {
        width: 100%;
        max-width: 100%;
    }

    .search-form {
        width: 100%;
        flex-wrap: wrap;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .url-cell {
        max-width: 150px;
    }

    .login-card {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .action-btns {
        flex-direction: column;
        gap: 0.5rem;
    }
}