/* Modern URL Shortener Styles */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --accent: #8b5cf6;
    --dark: #0f172a;
    --light: #f8fafc;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--dark);
    color: var(--light);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Animated Background */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    opacity: 0.1;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Floating Shapes */
.shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.shape {
    position: absolute;
    filter: blur(50px);
    opacity: 0.5;
    animation: float 20s infinite;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    border-radius: 50%;
    top: -200px;
    left: -200px;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: var(--secondary);
    border-radius: 50%;
    bottom: -150px;
    right: -150px;
    animation-delay: -5s;
}

.shape-3 {
    width: 200px;
    height: 200px;
    background: var(--accent);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

/* Navigation */
nav {
    padding: 1.5rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.nav-links a {
    color: var(--light);
    text-decoration: none;
    margin-left: 2rem;
    font-weight: 500;
    transition: all 0.3s;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient);
    transition: width 0.3s;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 8rem 5% 4rem;
    text-align: center;
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 1rem;
    background: linear-gradient(to right, #fff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: slideUp 0.8s ease-out;
}

.hero p {
    font-size: 1.25rem;
    color: #94a3b8;
    margin-bottom: 3rem;
    max-width: 600px;
    animation: slideUp 0.8s ease-out 0.2s both;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* URL Shortener Box */
.shortener-box {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 2rem;
    width: 100%;
    max-width: 800px;
    box-shadow: var(--shadow);
    animation: slideUp 0.8s ease-out 0.4s both;
    transition: transform 0.3s, box-shadow 0.3s;
}

.shortener-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.25);
}

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

.url-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 1rem;
    transition: all 0.3s;
}

.url-input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
}

.url-input::placeholder {
    color: #64748b;
}

.shorten-btn {
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 12px;
    background: var(--gradient);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.shorten-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
}

.shorten-btn:hover::before {
    left: 100%;
}

.shorten-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
}

/* Result Section */
.result-box {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 16px;
    display: none;
    animation: fadeIn 0.5s;
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.short-url-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.short-url {
    font-size: 1.5rem;
    color: var(--success);
    font-weight: 600;
    word-break: break-all;
}

.copy-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--success);
    background: transparent;
    color: var(--success);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.copy-btn:hover {
    background: var(--success);
    color: white;
}

/* Stats Cards */
.stats-section {
    padding: 4rem 5%;
    background: rgba(255, 255, 255, 0.02);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient);
    transform: scaleX(0);
    transition: transform 0.3s;
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.08);
}

.stat-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #94a3b8;
    font-size: 1rem;
}

/* Analytics Section */
.analytics-section {
    padding: 4rem 5%;
}

.analytics-box {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 2rem;
}

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

.analytics-btn {
    padding: 1rem 2rem;
    background: var(--secondary);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.analytics-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(236, 72, 153, 0.4);
}

.analytics-result {
    display: none;
    animation: fadeIn 0.5s;
}

.analytics-result.show {
    display: block;
}

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

.click-stat-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid var(--primary);
}

.click-stat-label {
    color: #94a3b8;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.click-stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
}

/* Features Section */
.features {
    padding: 4rem 5%;
    background: rgba(255, 255, 255, 0.02);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.2);
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
}

.feature-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: white;
}

.feature-desc {
    color: #94a3b8;
    line-height: 1.6;
}

/* Footer */
footer {
    padding: 3rem 5%;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #64748b;
}

/* Loading Animation */
.loader {
    display: none;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 1rem auto;
}

.loader.show {
    display: block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--success);
    color: white;
    padding: 1rem 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transform: translateX(400px);
    transition: transform 0.3s;
    z-index: 10000;
}

.toast.show {
    transform: translateX(0);
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .shorten-btn {
        width: 100%;
    }
    
    .nav-links {
        display: none;
    }
    
    .short-url-display {
        flex-direction: column;
        text-align: center;
    }
}

/* Admin Panel Styles */
.admin-body {
    background: #f1f5f9;
    color: var(--dark);
}

.admin-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    height: 100vh;
    background: white;
    box-shadow: var(--shadow);
    z-index: 1000;
    padding: 2rem;
}

.admin-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-menu {
    list-style: none;
}

.admin-menu li {
    margin-bottom: 0.5rem;
}

.admin-menu a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    color: #64748b;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s;
}

.admin-menu a:hover, .admin-menu a.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.admin-main {
    margin-left: 260px;
    padding: 2rem;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.admin-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--dark);
}

.admin-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th, .admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.admin-table th {
    font-weight: 600;
    color: #64748b;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-table tr:hover {
    background: #f8fafc;
}

.status-badge {
    display: inline-flex;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-active {
    background: #dcfce7;
    color: #166534;
}

.btn {
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

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

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* Geo Targeting Form */
.geo-form {
    display: grid;
    grid-template-columns: 1fr 1fr 2fr auto;
    gap: 1rem;
    align-items: end;
    margin-bottom: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
}

.form-select, .form-input {
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
}

.form-select:focus, .form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

@media (max-width: 1024px) {
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .admin-sidebar.open {
        transform: translateX(0);
    }
    
    .admin-main {
        margin-left: 0;
    }
    
    .geo-form {
        grid-template-columns: 1fr;
    }
}
/* Mobile Menu Toggle */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
    
    .nav-links {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background: rgba(15, 23, 42, 0.98);
        flex-direction: column;
        padding: 2rem;
        gap: 1.5rem;
        transform: translateY(-150%);
        transition: transform 0.3s;
    }
    
    .nav-links.active {
        transform: translateY(0);
    }
    
    .nav-links a {
        margin: 0;
        font-size: 1.25rem;
    }
}

/* Better touch targets */
button, 
.url-input,
.form-select,
.form-input,
.copy-btn,
.analytics-btn {
    min-height: 44px; /* iOS recommended minimum */
}

/* Prevent text selection on buttons */
button {
    user-select: none;
    -webkit-user-select: none;
}

/* Smooth animations reduced for mobile */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Toast positioning for mobile */
@media (max-width: 768px) {
    .toast {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        transform: translateY(200%);
    }
    
    .toast.show {
        transform: translateY(0);
    }
}