:root {
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #1e293b;
    --border-color: #e2e8f0;
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --success: #10b981;
    --error: #ef4444;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.dark-mode {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-color: #f1f5f9;
    --border-color: #334155;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: all 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.header {
    background: var(--card-bg);
    padding: 1rem 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

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

h1 a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.8rem;
    font-weight: 700;
}

h1 a:hover {
    color: #667eea;
}

.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
}

.input-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

input,
select,
textarea {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-color);
    transition: border-color 0.3s ease;
    font-size: 1rem;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.gradient-btn {
    background: var(--gradient);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.gradient-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

.gradient-btn.small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

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

.success-msg {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    border-left: 4px solid var(--success);
}

.error-msg {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    border-left: 4px solid var(--error);
}

.links-grid {
    display: grid;
    gap: 1rem;
}

.link-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: var(--bg-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.link-card:hover {
    background: var(--card-bg);
    border-color: #667eea;
}

.delete-btn {
    background: var(--error);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.delete-btn:hover {
    background: #dc2626;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: var(--card-bg);
}

.admin-table th,
.admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.admin-table th {
    background: var(--border-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

.admin-table tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

.search-form {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
    align-items: center;
    flex-wrap: wrap;
}

.search-form input {
    min-width: 200px;
}

.theme-btn {
    background: none;
    border: 2px solid var(--border-color);
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-btn:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem 1.5rem;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
    font-size: 0.9rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0.5rem 0;
    line-height: 1;
}

#clicksChart {
    max-height: 400px;
    width: 100% !important;
    margin: 1rem 0;
}

.chart-container {
    position: relative;
    height: 400px;
    margin: 2rem 0;
}

section.card h2 {
    margin-top: 1.5rem;
    font-size: 1.25rem;
    color: var(--text-color);
}

section.card ul {
    list-style: disc;
    padding-left: 2rem;
    margin-bottom: 1rem;
}

section.card p,
section.card ul li {
    margin-bottom: 0.75rem;
}

section.card a {
    color: #667eea;
    text-decoration: none;
}

section.card a:hover {
    text-decoration: underline;
}

footer p a {
    color: var(--text-color);
    margin: 0 0.5rem;
    text-decoration: none;
}

footer p a:hover {
    color: #667eea;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .container {
        padding: 0.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .input-group,
    .link-card,
    .header .container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .search-form {
        flex-direction: column;
        align-items: stretch;
    }

    .search-form input {
        min-width: auto;
    }

    .admin-table {
        font-size: 0.9rem;
    }

    .admin-table th,
    .admin-table td {
        padding: 0.5rem;
    }
}

@media (max-width: 480px) {
    .card {
        padding: 1rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    .gradient-btn {
        width: 100%;
        text-align: center;
        margin: 0.25rem 0;
    }
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.5s ease-out;
}

@media print {

    .header,
    .gradient-btn,
    .delete-btn,
    .theme-btn {
        display: none;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
.footer {
    background: var(--card-bg);
    color: var(--text-color);
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
    margin-top: 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.footer-section {
    position: relative;
}

.footer-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section li {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.footer-section a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: #5a6ed0;
    text-decoration: underline;
}

.footer-bottom {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.footer-bottom p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-color);
}

/* Updated styles for separators within sections */
.separator {
    margin: 0 0.5rem;
    color: var(--border-color);
    font-weight: bold;
}

/* Ensure last item in each section doesn't have a separator */
.footer-section ul li:last-child .separator {
    display: none;
}

/* New: Add vertical separators between all footer sections using borders */
.footer-section:not(:last-child) {
    border-right: 1px solid var(--border-color);
}

/* Adjust for mobile view */
@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-section li {
        justify-content: center;
    }

    .footer-section:not(:last-child) {
        border-right: none;
        /* Remove section separators on mobile */
    }
}
.header-nav {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}