:root {
    --bg-main: #07080d;
    --bg-card: rgba(18, 20, 32, 0.7);
    --bg-card-border: rgba(255, 255, 255, 0.08);
    --bg-card-hover: rgba(26, 29, 46, 0.85);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
    --primary-glow: rgba(99, 102, 241, 0.35);
    --cyan-glow: rgba(6, 182, 212, 0.3);
    
    --accent-cyan: #06b6d4;
    --accent-indigo: #6366f1;
    --accent-violet: #8b5cf6;
    --accent-green: #10b981;
    --accent-red: #ef4444;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-main);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Glowing Ambient Backgrounds */
.background-glows {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.35;
}

.glow-1 {
    top: -10%;
    left: 15%;
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, #6366f1, transparent 70%);
}

.glow-2 {
    top: 30%;
    right: 10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #ec4899, transparent 70%);
}

.glow-3 {
    bottom: -10%;
    left: 30%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #06b6d4, transparent 70%);
}

/* Container */
.container {
    max-width: 820px;
    margin: 0 auto;
    padding: 40px 20px 60px;
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 35px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 600;
    color: #a5b4fc;
    margin-bottom: 16px;
    backdrop-filter: blur(10px);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-green);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-green);
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.title {
    font-size: 2.6rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 10px;
}

.gradient-text {
    background: var(--primary-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 580px;
    margin: 0 auto;
    font-weight: 400;
}

/* Glass Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.main-generator {
    padding: 32px;
    margin-bottom: 28px;
    border: 1px solid rgba(99, 102, 241, 0.25);
    background: linear-gradient(180deg, rgba(26, 29, 48, 0.7) 0%, rgba(15, 17, 28, 0.75) 100%);
}

/* Form */
.url-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-field {
    width: 100%;
    padding: 15px 110px 15px 18px;
    background: rgba(10, 12, 20, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 1rem;
    outline: none;
    transition: all 0.2s ease;
}

.input-field:focus {
    border-color: var(--accent-indigo);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    background: rgba(14, 16, 28, 0.9);
}

.action-icon-btn {
    position: absolute;
    right: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.action-icon-btn:hover {
    background: rgba(99, 102, 241, 0.25);
    color: #fff;
    border-color: var(--accent-indigo);
}

/* Form Row */
.form-row {
    display: flex;
    gap: 16px;
}

.flex-1 {
    flex: 1;
}

.input-field-sub {
    width: 100%;
    padding: 12px 14px;
    background: rgba(10, 12, 20, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s;
}

.input-field-sub:focus {
    border-color: var(--accent-indigo);
    background: rgba(14, 16, 28, 0.85);
}

.select-box {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    cursor: pointer;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 14px 24px;
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 4px 20px var(--primary-glow);
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-size: 0.9rem;
    padding: 10px 18px;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    color: #fff;
}

/* Output Box */
.output-box {
    margin-top: 24px;
    padding: 22px;
    background: rgba(10, 13, 24, 0.85);
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: var(--radius-md);
    animation: fadeIn 0.3s ease-out;
}

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

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 8px;
}

.output-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 700;
    font-size: 1.05rem;
    color: #f1f5f9;
}

.icon-success {
    width: 20px;
    height: 20px;
    color: var(--accent-green);
}

.speed-tag {
    font-size: 0.78rem;
    font-weight: 600;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(56, 189, 248, 0.25);
}

.result-input-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.result-field {
    flex: 1;
    padding: 13px 16px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    color: #38bdf8;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 500;
    outline: none;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-copy {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 22px;
    background: #10b981;
    color: #ffffff;
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-copy:hover {
    background: #059669;
    transform: translateY(-1px);
}

.output-actions {
    display: flex;
    gap: 10px;
}

/* QR Code */
.qr-container {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.qr-canvas {
    padding: 12px;
    background: #ffffff;
    border-radius: var(--radius-md);
    display: inline-block;
}

.qr-hint {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* History Section */
.history-section {
    padding: 26px;
    margin-bottom: 30px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.history-title-group {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--text-primary);
}

.history-title-group h2 {
    font-size: 1.15rem;
    font-weight: 700;
}

.btn-text-danger {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: none;
    color: var(--accent-red);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.btn-text-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    background: rgba(10, 12, 20, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 14px 16px;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    transition: all 0.2s;
}

.history-item:hover {
    border-color: rgba(99, 102, 241, 0.3);
    background: rgba(14, 17, 30, 0.8);
}

.history-info {
    flex: 1;
    min-width: 0;
}

.history-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.history-tag {
    font-size: 0.75rem;
    font-weight: 700;
    color: #c084fc;
    background: rgba(192, 132, 252, 0.12);
    padding: 2px 7px;
    border-radius: 4px;
}

.history-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.history-new-url {
    font-family: var(--font-mono);
    font-size: 0.86rem;
    color: #38bdf8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    margin-bottom: 2px;
}

.history-orig-url {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.history-actions {
    display: flex;
    gap: 6px;
}

.btn-icon-action {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    padding: 7px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-action:hover {
    background: rgba(99, 102, 241, 0.2);
    color: #fff;
    border-color: var(--accent-indigo);
}

.btn-icon-action.delete:hover {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
    border-color: var(--accent-red);
}

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

.empty-state p {
    font-size: 0.9rem;
    margin-top: 8px;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 40px;
}

.feature-card {
    background: rgba(14, 16, 26, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 20px 16px;
    text-align: center;
}

.feature-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}

.feature-card h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.feature-card p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Footer */
.footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
    padding-top: 10px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #0f172a;
    border: 1px solid #22c55e;
    color: #f8fafc;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6), 0 0 15px rgba(34, 197, 94, 0.25);
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 9999;
    animation: slideUp 0.3s ease-out;
}

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

/* Utilities */
.hidden {
    display: none !important;
}

.icon-xs { width: 14px; height: 14px; }
.icon-sm { width: 17px; height: 17px; }
.icon-md { width: 20px; height: 20px; }
.icon-lg { width: 36px; height: 36px; stroke-width: 1.5; }

/* Responsive */
@media (max-width: 680px) {
    .container {
        padding: 25px 14px 40px;
    }
    .title {
        font-size: 2rem;
    }
    .main-generator {
        padding: 20px 16px;
    }
    .form-row {
        flex-direction: column;
    }
    .features-grid {
        grid-template-columns: 1fr;
    }
    .result-input-wrapper {
        flex-direction: column;
    }
    .btn-copy {
        justify-content: center;
        padding: 12px;
    }
}
