/* ============================================================
   KisaLink - Professional URL Shortener Theme
   ============================================================ */

/* === Base & Typography === */
:root {
    --primary: #1a56db;
    --primary-dark: #1240a8;
    --primary-light: #e8effd;
    --secondary: #0f172a;
    --accent: #0ea5e9;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --radius: 10px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -2px rgba(0,0,0,.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.06);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,.08), 0 8px 10px -6px rgba(0,0,0,.06);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
    font-family: var(--font);
    color: var(--gray-800);
    background: var(--gray-50);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--gray-900);
    font-weight: 700;
    line-height: 1.3;
}

a { color: var(--primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary-dark); }

/* === Navbar === */
.navbar-main {
    background: var(--secondary) !important;
    padding: .75rem 0;
    border-bottom: 3px solid var(--primary);
    box-shadow: var(--shadow-md);
}

.navbar-main .navbar-brand {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -.5px;
    color: #fff !important;
}

.navbar-main .navbar-brand span {
    color: var(--accent);
}

.navbar-main .nav-link {
    color: var(--gray-300) !important;
    font-weight: 500;
    font-size: .925rem;
    padding: .5rem 1rem !important;
    border-radius: 6px;
    transition: all .2s;
}

.navbar-main .nav-link:hover,
.navbar-main .nav-link.active {
    color: #fff !important;
    background: rgba(255,255,255,.08);
}

/* === Hero Section === */
.hero {
    background: linear-gradient(135deg, var(--secondary) 0%, #1e3a5f 50%, var(--primary-dark) 100%);
    position: relative;
    overflow: hidden;
    padding: 5rem 0 6rem;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 1;
}

.hero * { position: relative; z-index: 1; }

.hero h1 {
    color: #fff;
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -.02em;
    margin-bottom: 1.25rem;
}

.hero .lead {
    color: rgba(255,255,255,.75);
    font-size: 1.2rem;
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.hero .shorten-box {
    background: rgba(255,255,255,.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 16px;
    padding: 2rem;
    max-width: 700px;
    margin: 0 auto;
}

.hero .shorten-box .form-control {
    height: 54px;
    border: 2px solid rgba(255,255,255,.2);
    background: rgba(255,255,255,.95);
    border-radius: var(--radius);
    font-size: 1rem;
    padding: .75rem 1.25rem;
}

.hero .shorten-box .form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(14,165,233,.25);
}

.hero .shorten-box .btn {
    height: 54px;
    font-weight: 700;
    font-size: 1rem;
    padding: 0 2rem;
    border-radius: var(--radius);
    background: var(--accent);
    border: none;
    white-space: nowrap;
}

.hero .shorten-box .btn:hover {
    background: #0284c7;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(14,165,233,.35);
}

/* === Stats Counter Section === */
.stats-counter {
    margin-top: -3rem;
    position: relative;
    z-index: 10;
    padding-bottom: 2rem;
}

.stat-card {
    background: #fff;
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 1.75rem;
    text-align: center;
    transition: transform .2s, box-shadow .2s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.stat-card .stat-number {
    font-size: 2.25rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.stat-card .stat-label {
    color: var(--gray-500);
    font-size: .875rem;
    font-weight: 500;
    margin-top: .375rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* === Feature Section === */
.features-section {
    padding: 5rem 0;
    background: #fff;
}

.feature-card {
    text-align: center;
    padding: 2rem 1.5rem;
    border-radius: var(--radius);
    transition: all .3s;
    border: 1px solid transparent;
}

.feature-card:hover {
    background: var(--gray-50);
    border-color: var(--gray-200);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1.25rem;
    color: #fff;
}

.feature-icon.blue { background: linear-gradient(135deg, var(--primary), var(--accent)); }
.feature-icon.green { background: linear-gradient(135deg, #059669, #34d399); }
.feature-icon.orange { background: linear-gradient(135deg, #d97706, #fbbf24); }
.feature-icon.purple { background: linear-gradient(135deg, #7c3aed, #a78bfa); }

.feature-card h5 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: .5rem;
}

.feature-card p {
    color: var(--gray-500);
    font-size: .925rem;
    margin-bottom: 0;
}

/* === Section Title === */
.section-title {
    font-size: 2rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: .75rem;
    color: var(--gray-900);
}

.section-subtitle {
    text-align: center;
    color: var(--gray-500);
    font-size: 1.1rem;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* === Testimonials === */
.testimonials-section {
    padding: 5rem 0;
    background: var(--gray-50);
}

.testimonial-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 2rem;
    height: 100%;
    transition: all .3s;
    position: relative;
}

.testimonial-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.testimonial-card .stars {
    color: #f59e0b;
    font-size: 1rem;
    margin-bottom: .75rem;
    letter-spacing: 2px;
}

.testimonial-card .quote {
    color: var(--gray-600);
    font-size: .95rem;
    line-height: 1.7;
    font-style: italic;
    margin-bottom: 1.5rem;
    position: relative;
    padding-left: 1rem;
    border-left: 3px solid var(--primary-light);
}

.testimonial-card .author {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.testimonial-card .author-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .85rem;
    color: #fff;
    flex-shrink: 0;
}

.testimonial-card .author-name {
    font-weight: 600;
    font-size: .95rem;
    color: var(--gray-800);
}

.testimonial-card .author-title {
    font-size: .8rem;
    color: var(--gray-400);
}

/* === How it Works === */
.how-section {
    padding: 5rem 0;
    background: #fff;
}

.step-number {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

/* === Footer === */
.footer-main {
    background: var(--secondary);
    color: var(--gray-400);
    padding: 2rem 0;
    border-top: 3px solid var(--primary);
}

.footer-main .footer-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
}

.footer-main p {
    margin-bottom: 0;
    font-size: .9rem;
}

/* === Redirect Page === */
.redirect-hero {
    background: linear-gradient(135deg, var(--secondary), var(--primary-dark));
    padding: 2.5rem 0;
    margin-bottom: 2rem;
}

.redirect-hero h2 {
    color: #fff;
    font-weight: 700;
}

.countdown-wrapper {
    background: #fff;
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: var(--shadow-xl);
    text-align: center;
    border: 1px solid var(--gray-200);
}

#countdown {
    font-size: 4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: .5rem;
}

#countdownText {
    color: var(--gray-500);
    font-size: .95rem;
    margin-bottom: 1.5rem;
}

#btnGo {
    font-weight: 700;
    font-size: 1.1rem;
    padding: .875rem 3rem;
    border-radius: var(--radius);
    transition: all .3s;
    border: none;
    letter-spacing: .02em;
}

#btnGo:disabled {
    background: var(--gray-300);
    color: var(--gray-500);
    cursor: not-allowed;
}

#btnGo:not(:disabled) {
    background: linear-gradient(135deg, var(--success), #34d399);
    color: #fff;
    box-shadow: 0 4px 14px rgba(5,150,105,.35);
}

#btnGo:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(5,150,105,.45);
}

/* === Content Cards === */
.content-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .2s;
}

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

.content-card .card-header {
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 1.5rem;
    font-weight: 700;
    font-size: .95rem;
    color: var(--gray-700);
}

.content-card .card-body {
    padding: 1.5rem;
}

/* === Stats Display === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.stat-block {
    background: var(--gray-50);
    border-radius: 8px;
    padding: 1.25rem;
    border: 1px solid var(--gray-100);
}

.stat-block h6 {
    color: var(--primary);
    font-weight: 700;
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: .75rem;
    padding-bottom: .5rem;
    border-bottom: 2px solid var(--primary-light);
}

.stat-block ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.stat-block ul li {
    padding: .375rem 0;
    font-size: .9rem;
    color: var(--gray-600);
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--gray-100);
}

.stat-block ul li:last-child {
    border-bottom: none;
}

.stat-block ul li span.count {
    font-weight: 600;
    color: var(--gray-800);
}

.stat-big-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
}

.stat-inline {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.stat-inline-item {
    background: var(--gray-50);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    border: 1px solid var(--gray-100);
    flex: 1;
    min-width: 180px;
}

.stat-inline-item h6 {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--gray-400);
    margin-bottom: .25rem;
}

.stat-inline-item .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
}

/* === QR Code === */
.qr-card {
    text-align: center;
    padding: 2rem;
}

.qr-card img {
    border: 4px solid var(--gray-100);
    border-radius: 12px;
    padding: 8px;
    background: #fff;
}

/* === Typo / Recent / Similar === */
.typo-badge {
    display: inline-block;
    padding: .375rem .75rem;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    font-size: .85rem;
    color: var(--gray-600);
    margin: .25rem;
    font-family: monospace;
}

.recent-link {
    display: block;
    padding: .625rem 0;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
    font-size: .925rem;
    transition: padding-left .2s;
}

.recent-link:hover {
    padding-left: .5rem;
    color: var(--primary);
}

.recent-link:last-child { border-bottom: none; }

.similar-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--gray-100);
}

.similar-item:last-child { border-bottom: none; }

.similar-item a {
    font-weight: 600;
    font-size: 1rem;
}

.similar-item .desc {
    color: var(--gray-500);
    font-size: .875rem;
    margin-top: .25rem;
    line-height: 1.5;
}

/* === Alert Styling === */
.alert-service {
    background: linear-gradient(135deg, #fef2f2, #fff1f2);
    border: 1px solid #fecaca;
    border-radius: var(--radius);
    color: var(--danger);
    padding: 1.25rem 1.5rem;
    font-weight: 500;
}

/* === Install Page === */
.install-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    padding: 2rem 0;
}

.install-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    border: none;
    overflow: hidden;
}

.install-card .card-body {
    padding: 2.5rem;
}

.install-card h3 {
    font-weight: 800;
    color: var(--gray-900);
}

.install-card .form-label {
    font-weight: 600;
    font-size: .875rem;
    color: var(--gray-700);
}

/* === Admin Panel === */
.admin-nav {
    background: var(--secondary) !important;
    border-bottom: 3px solid var(--primary);
    box-shadow: var(--shadow);
}

.admin-nav .navbar-brand {
    font-weight: 800;
    font-size: 1.3rem;
}

.admin-nav .nav-link {
    font-size: .9rem;
    font-weight: 500;
    padding: .5rem .875rem !important;
    border-radius: 6px;
    transition: all .2s;
}

.admin-nav .nav-link:hover,
.admin-nav .nav-link.active {
    background: rgba(255,255,255,.1);
}

.admin-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.admin-card .card-header {
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    padding: .875rem 1.25rem;
    font-weight: 700;
    font-size: .9rem;
    color: var(--gray-700);
}

.admin-card .card-body {
    padding: 1.25rem;
}

.admin-stat {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all .2s;
    border-top: 3px solid transparent;
}

.admin-stat:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.admin-stat.blue { border-top-color: var(--primary); }
.admin-stat.green { border-top-color: var(--success); }
.admin-stat.cyan { border-top-color: var(--accent); }
.admin-stat.orange { border-top-color: var(--warning); }
.admin-stat.gray { border-top-color: var(--gray-400); }

.admin-stat h3 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: .25rem;
}

.admin-stat small {
    color: var(--gray-500);
    font-size: .8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .03em;
}

/* === Form Styling === */
.form-control, .form-select {
    border: 1.5px solid var(--gray-200);
    border-radius: 8px;
    padding: .625rem 1rem;
    font-size: .925rem;
    transition: all .2s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}

textarea.form-control {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: .85rem;
}

.btn {
    font-weight: 600;
    border-radius: 8px;
    padding: .5rem 1.25rem;
    font-size: .925rem;
    transition: all .2s;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26,86,219,.25);
}

.btn-success {
    background: var(--success);
    border-color: var(--success);
}

.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
}

/* === Tables === */
.table {
    font-size: .9rem;
}

.table thead th {
    background: var(--gray-50);
    font-weight: 600;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--gray-500);
    border-bottom: 2px solid var(--gray-200);
    padding: .75rem 1rem;
}

.table tbody td {
    padding: .75rem 1rem;
    vertical-align: middle;
    border-color: var(--gray-100);
}

.table-hover tbody tr:hover {
    background: var(--primary-light);
}

/* === Badge Overrides === */
.badge {
    font-weight: 600;
    font-size: .75rem;
    padding: .375rem .625rem;
    border-radius: 6px;
    letter-spacing: .02em;
}

/* === Pagination === */
.pagination .page-link {
    border-radius: 8px;
    margin: 0 2px;
    font-weight: 600;
    font-size: .875rem;
    border: 1px solid var(--gray-200);
    color: var(--gray-600);
}

.pagination .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
}

/* === Utility === */
.text-truncate-custom {
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.divider {
    height: 1px;
    background: var(--gray-200);
    margin: 2rem 0;
}

/* === Login Page === */
.login-wrapper {
    min-height: 100vh;
    background: var(--gray-100);
    display: flex;
    align-items: center;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    border: none;
    max-width: 400px;
    width: 100%;
}

.login-card .card-body {
    padding: 2.5rem;
}

/* === Queue === */
.queue-controls {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

.queue-badge {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem 1rem;
    border-radius: 8px;
    font-size: .85rem;
    font-weight: 600;
}

#currentProcess {
    border-left: 4px solid var(--accent);
    background: var(--primary-light);
    border-radius: 0 8px 8px 0;
}

/* === Responsive === */
@media (max-width: 768px) {
    .hero { padding: 3rem 0 4rem; }
    .hero h1 { font-size: 2rem; }
    .hero .lead { font-size: 1rem; }
    .hero .shorten-box { padding: 1.25rem; }
    .hero .shorten-box .form-control,
    .hero .shorten-box .btn { height: 48px; }
    .stats-counter { margin-top: -2rem; }
    .stat-card .stat-number { font-size: 1.75rem; }
    #countdown { font-size: 3rem; }
    .countdown-wrapper { padding: 1.5rem; }
    .stats-grid { grid-template-columns: 1fr; }
    .stat-inline { gap: 1rem; }
    .stat-inline-item { min-width: 140px; }
    .section-title { font-size: 1.5rem; }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 1.6rem; }
    .hero .shorten-box .d-flex { flex-direction: column; }
    .hero .shorten-box .btn { width: 100%; }
    .queue-controls { flex-direction: column; }
    .queue-controls .btn { width: 100%; }
}
