/* Google Fonts - Inter & Outfit */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --bg-primary: #070a13;
    --bg-gradient: radial-gradient(circle at 50% 0%, #111827 0%, #070a13 100%);
    
    --card-bg: rgba(15, 23, 42, 0.65);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-border-glow: rgba(6, 182, 212, 0.3);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-cyan: #06b6d4;
    --accent-cyan-rgb: 6, 182, 212;
    --accent-blue: #3b82f6;
    --accent-emerald: #10b981;
    --accent-rose: #f43f5e;
    
    --gradient-primary: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    --gradient-emerald: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-rose: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 25px rgba(6, 182, 212, 0.15);
    --shadow-glow-rose: 0 0 25px rgba(244, 63, 94, 0.15);
}

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

body {
    background: var(--bg-gradient);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Background grid overlay */
.bg-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: center top;
    pointer-events: none;
    z-index: 0;
}

header {
    width: 100%;
    max-width: 1200px;
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.025em;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
}

.logo svg {
    stroke: var(--accent-cyan);
}

.badge {
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.2);
    color: var(--accent-cyan);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

main {
    flex: 1;
    width: 100%;
    max-width: 680px;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 10;
}

/* Glassmorphism Card */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: var(--shadow-md), var(--shadow-glow);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-primary);
}

.card.danger::before {
    background: var(--gradient-rose);
}

.card.success::before {
    background: var(--gradient-emerald);
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

textarea {
    width: 100%;
    min-height: 180px;
    background: rgba(10, 15, 30, 0.6);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.25rem;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

textarea:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15), inset 0 2px 4px rgba(0,0,0,0.5);
}

/* Character count indicator */
.textarea-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Buttons */
.btn {
    width: 100%;
    background: var(--gradient-primary);
    color: var(--text-primary);
    border: none;
    border-radius: 16px;
    padding: 1.1rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.45);
}

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

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

/* Typography & Titles */
h1 {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 2.25rem;
    line-height: 1.25;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #ffffff 30%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.lead {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 2rem;
}

/* Link Output Area */
.result-container {
    display: none;
    margin-top: 2rem;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.link-box {
    display: flex;
    background: rgba(10, 15, 30, 0.8);
    border: 1px solid rgba(6, 182, 212, 0.25);
    border-radius: 16px;
    padding: 0.5rem 0.5rem 0.5rem 1.25rem;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.link-text {
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--accent-cyan);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    user-select: all;
    flex: 1;
}

.btn-copy {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    font-weight: 700;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.2s, background 0.2s;
}

.btn-copy:hover {
    transform: scale(1.02);
}

.btn-copy.copied {
    background: var(--gradient-emerald);
}

/* Steps list */
.security-features {
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 1.5rem;
}

.feature-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.feature-item svg {
    flex-shrink: 0;
    color: var(--accent-cyan);
    margin-top: 0.15rem;
}

.feature-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

/* Decryption page message display */
.decrypted-box {
    background: rgba(10, 15, 30, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 350px;
    overflow-y: auto;
    border-left: 4px solid var(--accent-cyan);
    user-select: text;
}

.warning-banner {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.2);
    padding: 1.25rem;
    border-radius: 16px;
    color: #fda4af;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.warning-banner svg {
    color: var(--accent-rose);
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.warning-title {
    font-weight: 700;
    margin-bottom: 0.25rem;
    font-family: var(--font-heading);
}

/* Loading Spinner */
.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 3rem 0;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(6, 182, 212, 0.1);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Error/Not Found screen styling */
.error-icon-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.error-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(244, 63, 94, 0.1);
    border: 2px dashed rgba(244, 63, 94, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-rose);
    animation: pulseGlow 2s infinite ease-in-out;
}

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

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

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(244, 63, 94, 0.1);
        border-color: rgba(244, 63, 94, 0.3);
    }
    50% {
        box-shadow: 0 0 25px rgba(244, 63, 94, 0.3);
        border-color: rgba(244, 63, 94, 0.7);
    }
}

footer {
    width: 100%;
    padding: 2rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    z-index: 10;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

footer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

footer a:hover {
    color: var(--accent-cyan);
}

/* Responsive adjustments */
@media (max-width: 640px) {
    header {
        padding: 1.5rem 1rem;
    }
    main {
        padding: 1rem;
    }
    .card {
        padding: 1.5rem;
        border-radius: 20px;
    }
    h1 {
        font-size: 1.75rem;
    }
    .link-box {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
    }
    .btn-copy {
        justify-content: center;
    }
}
