/*
Theme Name: URL Shortener
Theme URI: https://myreadybank.com
Author: Asif
Author URI: https://myreadybank.com
Description: A clean, modern URL Shortener WordPress Theme with redirect support.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: url-shortener
Tags: url-shortener, redirect, minimal, custom
*/

/* =============================================
   RESET & BASE
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary:    #6C63FF;
    --primary-dk: #4B44CC;
    --bg:         #0F0F1A;
    --bg2:        #1A1A2E;
    --card:       #16213E;
    --border:     #2A2A4A;
    --text:       #E0E0F0;
    --muted:      #8888AA;
    --success:    #00D97E;
    --danger:     #FF4D6D;
    --radius:     12px;
    --shadow:     0 4px 24px rgba(0,0,0,0.4);
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

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

img { max-width: 100%; height: auto; }

/* =============================================
   LAYOUT
   ============================================= */
.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

.container--wide {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =============================================
   HEADER
   ============================================= */
.site-header {
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1100px;
}

.site-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-logo span {
    color: var(--primary);
}

.site-logo .logo-icon {
    width: 36px; height: 36px;
    background: var(--primary);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
}

.site-nav ul {
    list-style: none;
    display: flex;
    gap: 24px;
}

.site-nav a {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color .2s;
}

.site-nav a:hover { color: var(--text); }

/* =============================================
   HERO / SHORTENER BOX
   ============================================= */
.hero-section {
    padding: 60px 0 40px;
    text-align: center;
}

.hero-title {
    font-size: 2.4rem;
    font-weight: 800;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #fff 30%, var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    color: var(--muted);
    font-size: 1.05rem;
    margin-bottom: 36px;
}

/* =============================================
   SHORTENER FORM
   ============================================= */
.shortener-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.shortener-form {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.shortener-form input[type="url"],
.shortener-form input[type="text"] {
    flex: 1;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 18px;
    color: var(--text);
    font-size: 1rem;
    outline: none;
    transition: border-color .2s;
}

.shortener-form input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108,99,255,0.15);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all .2s;
}

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

.btn-primary:hover {
    background: var(--primary-dk);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(108,99,255,0.35);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 0.85rem;
}

.btn-copy {
    background: var(--bg2);
    border: 1px solid var(--border);
    color: var(--text);
}

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

.btn-delete {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--danger);
}

.btn-delete:hover { background: rgba(255,77,109,0.1); border-color: var(--danger); }

/* =============================================
   RESULT BOX
   ============================================= */
.result-box {
    background: var(--bg2);
    border: 1px solid var(--success);
    border-radius: 8px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    display: none;
}

.result-box.show { display: flex; }

.result-url {
    color: var(--success);
    font-weight: 600;
    word-break: break-all;
}

.result-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* =============================================
   STATS BAR
   ============================================= */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
}

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

.stat-label {
    color: var(--muted);
    font-size: 0.85rem;
    margin-top: 4px;
}

/* =============================================
   LINKS TABLE
   ============================================= */
.links-section { margin-bottom: 48px; }

.section-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text);
}

.links-table {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.links-table-head {
    display: grid;
    grid-template-columns: 2fr 3fr 80px 120px 80px;
    padding: 12px 20px;
    background: var(--bg2);
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}

.links-table-row {
    display: grid;
    grid-template-columns: 2fr 3fr 80px 120px 80px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    align-items: center;
    transition: background .2s;
}

.links-table-row:last-child { border-bottom: none; }
.links-table-row:hover { background: rgba(108,99,255,0.05); }
.row-country { text-align: center; font-size: 0.85rem; color: var(--muted); }

.short-url { color: var(--primary); font-weight: 600; font-size: 0.9rem; }
.long-url { color: var(--muted); font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.click-count { text-align: center; font-weight: 700; color: var(--success); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

.empty-state {
    padding: 40px;
    text-align: center;
    color: var(--muted);
}

/* =============================================
   ALERT / NOTICE
   ============================================= */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.alert-success { background: rgba(0,217,126,0.1); border: 1px solid var(--success); color: var(--success); }
.alert-error   { background: rgba(255,77,109,0.1); border: 1px solid var(--danger);  color: var(--danger);  }

/* =============================================
   FOOTER
   ============================================= */
.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding: 24px 0;
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
}

/* =============================================
   ADMIN DASHBOARD (wp-admin style pages)
   ============================================= */
.admin-wrap {
    padding: 32px 0;
}

.admin-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 640px) {
    .hero-title { font-size: 1.7rem; }
    .shortener-form { flex-direction: column; }
    .stats-bar { grid-template-columns: 1fr; gap: 12px; }
    .links-table-head,
    .links-table-row {
        grid-template-columns: 1fr 1fr;
        gap: 4px;
    }
    .site-nav { display: none; }
}
