/* Base Styling */
:root {
    --primary-color: #6e46ff;
    --primary-light: #8d6dff;
    --secondary-color: #2aeeff;
    --background-dark: #0f172a;
    --text-light: #e2e8f0;
    --text-dark: #334155;
    --panel-bg: rgba(255, 255, 255, 0.08);
    --glow-color: rgba(110, 70, 255, 0.6);
    --accent-color: #ff3e7f;
}

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

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--background-dark);
    color: var(--text-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
}

/* Background Animation */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.2;
    animation: float 20s infinite ease-in-out;
}

.shape1 {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    width: 600px;
    height: 600px;
    top: -200px;
    right: -100px;
    animation-delay: 0s;
}

.shape2 {
    background: linear-gradient(45deg, #ff2d75, var(--primary-color));
    width: 500px;
    height: 500px;
    bottom: -150px;
    left: -100px;
    animation-delay: -5s;
}

.shape3 {
    background: linear-gradient(45deg, var(--secondary-color), #06b6d4);
    width: 400px;
    height: 400px;
    top: 40%;
    left: 30%;
    animation-delay: -10s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0);
    }

    25% {
        transform: translate(50px, -50px);
    }

    50% {
        transform: translate(0, 50px);
    }

    75% {
        transform: translate(-50px, -25px);
    }
}

/* App Container */
.app-container {
    width: 90%;
    max-width: 1000px;
    margin: 40px 0;
    perspective: 1000px;
}

/* Glass Panel */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    animation: panelAppear 0.8s ease-out forwards;
}

@keyframes panelAppear {
    0% {
        transform: rotateX(20deg) translateY(100px);
        opacity: 0;
    }

    100% {
        transform: rotateX(0) translateY(0);
        opacity: 1;
    }
}

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

.title {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.8rem;
    letter-spacing: 2px;
    margin-bottom: 12px;
    background: linear-gradient(to right, var(--text-light), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: titleGlow 2s infinite alternate;
}

.highlight {
    color: var(--accent-color);
}

.subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    font-weight: 300;
    margin-bottom: 16px;
}

.datetime {
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 1px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 16px;
}

@keyframes titleGlow {
    from {
        text-shadow: 0 0 10px rgba(46, 239, 255, 0);
    }

    to {
        text-shadow: 0 0 15px rgba(46, 239, 255, 0.5);
    }
}

/* Output Section */
.output-section {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 24px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.5s ease-in-out forwards;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 12px;
}

.preview-header h2 {
    font-size: 1.3rem;
    font-weight: 500;
}

.keyword-count {
    background: rgba(110, 70, 255, 0.2);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.9rem;
}

.keywords-container {
    min-height: 200px;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
    padding-right: 8px;
}

.keywords-container::-webkit-scrollbar {
    width: 6px;
}

.keywords-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.keywords-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.keywords-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top: 4px solid var(--secondary-color);
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.keyword-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 6px 12px;
    margin: 4px;
    font-size: 0.9rem;
    transition: all 0.2s;
    animation: badgeAppear 0.3s ease-out forwards;
}

.keyword-badge:hover {
    background: rgba(110, 70, 255, 0.2);
    transform: translateY(-2px);
}

@keyframes badgeAppear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.action-button {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.action-button::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
            transparent,
            rgba(255, 255, 255, 0.2),
            transparent);
    transform: rotate(45deg);
    transition: all 0.5s;
    opacity: 0;
}

.action-button:hover::before {
    animation: shine 1.5s ease-out;
    opacity: 1;
}

.copy-button {
    background: rgba(46, 239, 255, 0.15);
    color: var(--secondary-color);
}

.copy-button:hover {
    background: rgba(46, 239, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(42, 238, 255, 0.2);
}

.formatted-button {
    background: rgba(255, 62, 127, 0.15);
    color: var(--accent-color);
}

.formatted-button:hover {
    background: rgba(255, 62, 127, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 62, 127, 0.2);
}

.btn-icon {
    margin-right: 8px;
}

@keyframes shine {
    0% {
        left: -100%;
        opacity: 0.7;
    }

    100% {
        left: 100%;
        opacity: 0;
    }
}

/* Instruction Box */
.instruction-box {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid var(--primary-color);
}

.instruction-box h3 {
    margin-bottom: 12px;
    color: var(--secondary-color);
    font-size: 1.1rem;
}

.instruction-box ol {
    padding-left: 20px;
}

.instruction-box li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.instruction-box li:last-child {
    margin-bottom: 0;
}

/* Toast Notification */
#toast,
.toast {
    display: none;
    /* Hide by default */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

/* Show only when display:block is applied */
#toast.show {
    display: block;
}

/* Footer */
footer {
    margin-top: 20px;
    margin-bottom: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Media Queries */
@media (max-width: 768px) {
    .glass-panel {
        padding: 24px;
    }

    .title {
        font-size: 2rem;
    }

    .action-buttons {
        flex-direction: column;
    }
}