/* ==========================================
   LinkShortener - Custom CSS
   Adf.ly Style Link Shortener
   ========================================== */

/* ===== Base Styles ===== */
:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #764ba2;
    --success: #28a745;
    --info: #17a2b8;
    --warning: #ffc107;
    --danger: #dc3545;
    --light: #f8f9fa;
    --dark: #343a40;
    --white: #ffffff;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #333;
    background: var(--light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== Navigation ===== */
.navbar-dark.bg-primary-gradient {
    background: var(--gradient-primary) !important;
    box-shadow: var(--shadow);
    padding: 0.75rem 1rem;
}

.navbar-brand {
    font-size: 1.5rem;
    letter-spacing: -0.5px;
}

.nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--white) !important;
    opacity: 0.9;
}

/* ===== Hero Section ===== */
.hero-section {
    background: var(--gradient-primary);
    padding: 5rem 0 8rem;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.05" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,112C672,96,768,96,864,112C960,128,1056,160,1152,160C1248,160,1344,128,1392,112L1440,96L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom center;
    background-size: cover;
}

.shortener-form {
    max-width: 700px;
    margin: 0 auto;
}

.shortener-form .input-group {
    border-radius: 50px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.shortener-form .form-control {
    border: none;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
}

.shortener-form .btn {
    padding: 1rem 2rem;
    font-weight: 600;
    border: none;
}

/* ===== Feature Cards ===== */
.feature-card {
    border-radius: 15px;
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05) !important;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg) !important;
}

.feature-icon {
    width: 70px;
    height: 70px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    background: var(--light);
}

/* ===== Counter Section ===== */
.counter-item h2 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

/* ===== Buttons ===== */
.btn-primary-gradient {
    background: var(--gradient-primary);
    color: white;
    border: none;
    transition: all 0.3s ease;
}

.btn-primary-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    color: white;
}

.btn-warning-gradient {
    background: linear-gradient(135deg, #ffc107 0%, #ff8c00 100%);
    color: #333;
    border: none;
    font-weight: 600;
}

/* ===== Cards ===== */
.card {
    border-radius: 12px;
    overflow: hidden;
}

.card.border-left-primary {
    border-left: 4px solid var(--primary) !important;
}

.card.border-left-success {
    border-left: 4px solid var(--success) !important;
}

.card.border-left-warning {
    border-left: 4px solid var(--warning) !important;
}

.card.border-left-info {
    border-left: 4px solid var(--info) !important;
}

.card.border-left-purple {
    border-left: 4px solid #8b5cf6 !important;
}
.text-purple {
    color: #8b5cf6 !important;
}

/* ===== Sidebar ===== */
.sidebar {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    padding: 0;
    overflow: hidden;
}
.sidebar-profile {
    background: var(--gradient-primary);
    padding: 24px 20px 20px;
    text-align: center;
    color: #fff;
}
.sidebar-profile .avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    border: 3px solid rgba(255,255,255,0.4);
}
.sidebar-balance {
    padding: 14px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.sidebar .nav-link {
    color: #444;
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 2px;
    font-weight: 500;
    transition: all 0.2s ease;
}
.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: var(--gradient-primary);
    color: #fff !important;
}

/* Notice Bar */
.notice-bar {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    border-radius: 10px;
    overflow: hidden;
    height: 40px;
    width: 100%;
}
.notice-scroll {
    display: inline-block;
    white-space: nowrap;
    animation: scrollNotice 20s linear infinite;
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
}
.notice-scroll span {
    display: inline-block;
    padding: 0 20px;
    line-height: 40px;
}
@keyframes scrollNotice {
    0% { transform: translateX(100vw); }
    100% { transform: translateX(-100%); }
}

/* Sticky sidebar (admin) */
.sticky-sidebar {
    position: sticky;
    top: 90px;
}

/* short.php — full viewport layout */
html, body {
    height: 100vh;
}
body {
    display: flex;
    flex-direction: column;
    background: #f0f2f5;
}

/* Banner wraps */
.top-banner-wrap {
    height: auto;
    min-height: 50px;
    padding: 6px 0;
    background: #fff;
    border-bottom: 1px solid #e9ecef;
}
.bottom-banner-wrap {
    height: auto;
    min-height: 50px;
    padding: 6px 0;
    background: #fff;
    border-top: 1px solid #e9ecef;
}

/* Main area — flex row */
.main-area {
    overflow: hidden;
    background: #f0f2f5;
}

/* Inline timer row */
.timer-inline {
    background: #fff;
    border-radius: 24px;
    padding: 8px 16px !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* Side ad columns (desktop 300×250) */
.side-ad-col {
    width: 300px;
    min-width: 300px;
    height: 250px;
    margin: auto 8px;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    background: #fff;
    color: #adb5bd;
    font-size: 0.85rem;
}

/* Center content */
.center-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    position: relative;
}

/* Inline timer row - absolute overlay at bottom */
.timer-inline {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    background: rgba(255,255,255,0.95);
    border-radius: 24px;
    padding: 8px 16px !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    white-space: nowrap;
}

/* Visit count overlay */
.visit-count-overlay {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}
.visit-count-overlay small {
    background: rgba(255,255,255,0.85);
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
}

/* Footer */
.footer-minimal {
    height: 36px;
    background: #fff;
    border-top: 1px solid #e9ecef;
    font-size: 0.8rem;
}

/* Responsive: tablet & mobile */
@media (max-width: 768px) {
    .side-ad-col {
        width: 80px;
        min-width: 80px;
        height: 80px;
        margin: auto 4px;
        font-size: 0.55rem;
    }
    .timer-inline {
        gap: 0.4rem !important;
        padding: 5px 10px !important;
        font-size: 0.78rem;
        bottom: 52px;
    }
    .timer-inline .gap-2 {
        gap: 0.2rem !important;
    }
    .timer-inline .btn {
        font-size: 0.7rem;
        padding: 3px 8px !important;
    }
    .timer-inline strong {
        font-size: 0.82rem;
    }
    .visit-count-overlay {
        bottom: 12px;
    }
    .visit-count-overlay small {
        font-size: 0.65rem;
        padding: 1px 8px;
    }
    .video-container {
        border-radius: 6px;
    }
}

@media (max-width: 480px) {
    .side-ad-col {
        width: 60px;
        min-width: 60px;
        height: 60px;
        font-size: 0.5rem;
        margin: auto 2px;
    }
    .timer-inline {
        gap: 0.3rem !important;
        padding: 4px 8px !important;
        font-size: 0.7rem;
        bottom: 46px;
    }
    .timer-inline .btn {
        font-size: 0.65rem;
        padding: 2px 6px !important;
    }
    .timer-inline strong {
        font-size: 0.75rem;
    }
    .timer-inline .gap-2 {
        gap: 0.15rem !important;
    }
    .visit-count-overlay {
        bottom: 8px;
    }
    .timer-inline > small:last-child {
        font-size: 0.65rem !important;
    }
    .main-area {
        gap: 0;
    }
}

/* Ad containers for banners */
.ad-container {
    min-height: 90px;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
    font-size: 0.85rem;
}



/* Admin Sidebar */
.admin-sidebar {
    background: var(--dark) !important;
    border-radius: 12px;
}

.admin-sidebar .nav-link {
    color: rgba(255,255,255,0.7) !important;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.25rem;
    transition: all 0.3s ease;
}

.admin-sidebar .nav-link:hover, .admin-sidebar .nav-link.active {
    background: rgba(255,255,255,0.1);
    color: white !important;
}

.admin-sidebar .nav-heading {
    color: rgba(255,255,255,0.4);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
}

/* ===== Stats Cards ===== */
.counter {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
}

/* ===== Tables ===== */
.table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    color: #666;
}

.table-hover tbody tr {
    transition: all 0.2s ease;
}

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

/* ===== Badges ===== */
.badge {
    font-weight: 500;
    padding: 0.4em 0.8em;
}

/* ===== Forms ===== */
.form-control, .form-select {
    border-radius: 8px;
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-label {
    font-weight: 600;
    color: #555;
    margin-bottom: 0.5rem;
}

/* ===== Modal ===== */
.modal-content {
    border-radius: 15px;
    border: none;
    overflow: hidden;
}

.modal-header {
    background: var(--light);
    border-bottom: 1px solid #eee;
}

/* ===== Welcome Banner ===== */
.welcome-banner {
    border-radius: 15px;
    background: var(--gradient-primary);
}

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

.animate-fade-in {
    animation: fadeIn 0.6s ease forwards;
}

.animate-fade-in-delay {
    opacity: 0;
    animation: fadeIn 0.6s ease forwards 0.3s;
}

.animate-fade-in-delay-2 {
    opacity: 0;
    animation: fadeIn 0.6s ease forwards 0.6s;
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
}

/* ===== Footer ===== */
footer {
    margin-top: auto;
}

/* ===== Alerts ===== */
.alert {
    border: none;
    border-radius: 10px;
}

/* ===== Progress Bars ===== */
.progress {
    height: 8px;
    border-radius: 4px;
    background: #e9ecef;
}

.progress-bar {
    border-radius: 4px;
    transition: width 1s linear;
}

/* ===== Text Truncate ===== */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.d-inline-block {
    display: inline-block;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .hero-section {
        padding: 3rem 0 5rem;
    }
    
    .counter-item h2 {
        font-size: 2rem;
    }
    
    .counter {
        font-size: 1.5rem;
    }
    
    .sidebar {
        margin-bottom: 1.5rem;
    }
    
    .ad-container {
        min-height: 60px;
    }
}

@media (max-width: 576px) {
    .hero-section h1 {
        font-size: 1.8rem;
    }
    
    .feature-card {
        margin-bottom: 1rem;
    }
    
    .table-responsive {
        font-size: 0.85rem;
    }
}

/* ===== Utilities ===== */
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow { box-shadow: var(--shadow) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }

.rounded-4 { border-radius: 15px !important; }

.bg-primary-gradient { background: var(--gradient-primary) !important; }
.bg-success-gradient { background: var(--gradient-success) !important; }

.text-gray-300 { color: #dee2e6 !important; }
.text-gray-800 { color: #343a40 !important; }

.font-weight-bold { font-weight: 700 !important; }

.ms-auto { margin-left: auto !important; }

.d-flex { display: flex !important; }
.align-items-center { align-items: center !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.flex-grow-1 { flex-grow: 1; }

.g-3 { gap: 1rem !important; }
.g-4 { gap: 1.5rem !important; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ===== Selection ===== */
::selection {
    background: rgba(102, 126, 234, 0.3);
    color: #333;
}
