﻿@import url('https://fonts.googleapis.com/css2?family=Iosevka+Charon+Mono:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700&display=swap');

:root {
    --bg-dark: #000000;
    --bg-secondary: #0a0a0a;
    --bg-tertiary: #141414;
    --accent-primary: #00d084;
    --accent-secondary: #0066ff;
    --accent-tertiary: #7c3aed;
    --text-main: #ffffff;
    --text-secondary: #e4e4e7;
    --text-muted: #71717a;
    --border-color: #27272a;
    --gradient-primary: linear-gradient(135deg, #00d084 0%, #0066ff 50%, #7c3aed 100%);
    --gradient-soft: linear-gradient(135deg, rgba(0, 208, 132, 0.1) 0%, rgba(0, 102, 255, 0.1) 100%);
}

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

html, body {
    width: 100%;
    height: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Iosevka Charon Mono', monospace;
    background: linear-gradient(135deg, #000000 0%, #0a0a0a 50%, #000000 100%);
    background-attachment: fixed;
    color: var(--text-main);
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(0, 208, 132, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(124, 58, 237, 0.08) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

.container {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Hero Section */
h1 {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 0.8rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
    text-align: center;
}

p {
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.6;
    text-align: center;
    margin-bottom: 1.2rem;
    max-width: 600px;
    font-weight: 400;
}

.phase.hidden {
    display: none !important;
}

.phase {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.main-card {
    width: 100%;
    max-width: 700px;
    background: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 20px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Form Styling */
#shorten-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

#divider {
    border: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
    margin: 1rem 0 0.8rem 0;
    width: 100%;
    transition: opacity 0.5s ease;
}

.error-msg {
    margin-top: 1rem;
    padding: 0.8rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border-radius: 12px;
    font-size: 0.85rem;
    text-align: center;
    width: 100%;
    animation: slideDownFade 0.4s cubic-bezier(0.23, 1, 0.32, 1) forwards;
    overflow: hidden;
}

#divider.hidden {
    display: none;
}

/* Result Container */
#phase-result {
    width: 100%;
    animation: slideDownFade 0.7s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

#result-container {
    width: 100%;
}

input[type="url"],
#id-input,
.result-field input {
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid var(--border-color);
    padding: 0.8rem 1rem;
    border-radius: 12px;
    font-size: 1rem;
    color: var(--text-secondary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    font-weight: 500;
    font-family: 'Iosevka Charon Mono', monospace;
}

input[type="url"]::placeholder,
#id-input::placeholder {
    color: var(--text-muted);
}

input:focus {
    border-color: var(--accent-primary);
    box-shadow: 
        0 0 0 3px rgba(0, 208, 132, 0.1),
        inset 0 0 0 1px rgba(0, 208, 132, 0.2);
    background: rgba(20, 20, 20, 1);
}

.custom-id-container {
    display: flex;
    gap: 1rem;
    width: 100%;
}

#id-input {
    flex: 1;
}

#random-btn {
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid var(--border-color);
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-secondary);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    min-width: 60px;
    font-family: 'Iosevka Charon Mono', monospace;
}

#random-btn:hover {
    border-color: var(--accent-primary);
    background: rgba(0, 208, 132, 0.05);
    transform: translateY(-2px);
}

#random-btn:active {
    transform: translateY(0);
}

button[type="submit"] {
    background: var(--accent-primary);
    color: var(--bg-dark);
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    margin-top: 0.5rem;
    font-family: 'Iosevka Charon Mono', monospace;
}

button[type="submit"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s;
}

button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 208, 132, 0.3);
}

button[type="submit"]:hover::before {
    left: 100%;
}

button[type="submit"]:active {
    transform: translateY(0);
}


#result-container p {
    margin-bottom: 0.8rem;
    color: var(--text-secondary);
}

@keyframes slideDownFade {
    0% {
        opacity: 0;
        transform: translateY(-20px);
        max-height: 0;
        margin-top: 0;
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        max-height: 500px;
        margin-top: 1rem;
    }
}


#result-container p {
    margin-bottom: 0.8rem;
    color: var(--text-secondary);
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.result-field {
    display: flex;
    gap: 1rem;
    width: 100%;
}

.result-field input {
    flex: 1;
    background: rgba(14, 14, 14, 0.8);
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    font-family: 'Iosevka Charon Mono', monospace;
    font-weight: 600;
    font-size: 1rem;
}

.result-field input:focus {
    box-shadow: 
        0 0 0 3px rgba(0, 208, 132, 0.1),
        inset 0 0 0 1px rgba(0, 208, 132, 0.3);
}

#copy-btn {
    background: linear-gradient(135deg, rgba(0, 208, 132, 0.1), rgba(0, 102, 255, 0.1));
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'Iosevka Charon Mono', monospace;
}

#copy-btn:hover {
    background: rgba(0, 208, 132, 0.15);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 208, 132, 0.2);
}

#copy-btn:active {
    transform: translateY(0);
}

.hidden {
    display: none;
}

/* Decrypt Animation */
#decrypt-animation {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    border: 2px solid var(--accent-primary);
    padding: 3rem 4rem;
    border-radius: 16px;
    box-shadow: 
        0 0 60px rgba(0, 208, 132, 0.4),
        inset 0 0 40px rgba(0, 208, 132, 0.1);
    animation: floatIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 90vw;
    word-break: break-all;
}

#decrypt-text {
    font-family: 'Iosevka Charon Mono', monospace;
    font-size: 1.4rem;
    color: var(--accent-primary);
    font-weight: 700;
    letter-spacing: 0.15em;
    text-shadow: 
        0 0 10px rgba(0, 208, 132, 0.5),
        0 0 20px rgba(0, 102, 255, 0.2);
    display: block;
    animation: glitch 0.1s infinite;
    white-space: break-spaces;
    line-height: 1.8;
}

@keyframes floatIn {
    0% {
        opacity: 0;
        transform: translate(-50%, 20%);
        scale: 0.8;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%);
        scale: 1;
    }
}

@keyframes glitch {
    0% {
        text-shadow: 
            0 0 10px rgba(0, 208, 132, 0.5),
            0 0 20px rgba(0, 102, 255, 0.2);
    }
    50% {
        text-shadow: 
            -2px 0 10px rgba(0, 208, 132, 0.4),
            2px 0 10px rgba(124, 58, 237, 0.3),
            0 0 20px rgba(0, 102, 255, 0.3);
    }
    100% {
        text-shadow: 
            0 0 10px rgba(0, 208, 132, 0.5),
            0 0 20px rgba(0, 102, 255, 0.2);
    }
}

#decrypt-animation.fade-out {
    animation: floatOut 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes floatOut {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1.5rem;
        min-height: auto;
        padding-top: 5rem;
        padding-bottom: 5rem;
    }

    h1 {
        font-size: 2.5rem;
    }

    p {
        font-size: 1.1rem;
        margin-bottom: 2.5rem;
    }

    #shorten-form,
    #result-container {
        padding: 2rem;
        border-radius: 16px;
        max-width: 100%;
    }

    input[type="url"],
    #id-input,
    .result-field input {
        padding: 1rem 1.2rem;
        font-size: 1rem;
    }

    button[type="submit"] {
        padding: 1.2rem 1.5rem;
        font-size: 1rem;
    }

    .custom-id-container {
        flex-direction: column;
    }

    #id-input {
        width: 100%;
    }

    #random-btn {
        width: 100%;
    }

    .result-field {
        flex-direction: column;
    }

    #copy-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2rem;
        margin-bottom: 1rem;
    }

    p {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    #shorten-form,
    #result-container {
        padding: 1.5rem;
    }

    input[type="url"],
    #id-input,
    .result-field input {
        padding: 0.9rem 1rem;
        font-size: 0.95rem;
    }

    button[type="submit"] {
        padding: 1rem 1.2rem;
        font-size: 0.9rem;
    }

    .result-field {
        gap: 0.8rem;
    }
}
