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

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

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    --success-color: #10b981;
    --error-color: #ef4444;
    --bg-dark: #0a0f1e;
    --bg-darker: #050813;
    --card-bg: rgba(15, 23, 42, 0.6);
    --card-border: rgba(99, 102, 241, 0.2);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    --shadow-sm: 0 2px 8px rgba(99, 102, 241, 0.1);
    --shadow-md: 0 8px 24px rgba(99, 102, 241, 0.15);
    --shadow-lg: 0 16px 48px rgba(99, 102, 241, 0.2);
    --glow: 0 0 20px rgba(99, 102, 241, 0.4);
    --glow-strong: 0 0 40px rgba(99, 102, 241, 0.6);
    --sidebar-width: 340px;
    --nav-height: 70px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-dark) 50%, #0d1628 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(236, 72, 153, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
    animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }
}

/* Top Navigation */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--card-border);
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.nav-content {
    max-width: 100%;
    height: 100%;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-icon {
    font-size: 2rem;
}

.brand-text {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.nav-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

/* App Container */
.app-container {
    display: flex;
    margin-top: var(--nav-height);
    min-height: calc(100vh - var(--nav-height) - 60px);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(20px) saturate(180%);
    border-right: 1px solid var(--card-border);
    padding: 2rem 1.5rem;
    overflow-y: auto;
    position: sticky;
    top: var(--nav-height);
    height: calc(100vh - var(--nav-height));
}

.sidebar-section {
    margin-bottom: 2rem;
    animation: fadeInLeft 0.6s ease-out;
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.section-icon {
    font-size: 1.5rem;
}

.section-header h2 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

/* Select Input */
.select-input {
    width: 100%;
    padding: 1rem 1.25rem;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border: 2px solid var(--card-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.select-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15), var(--glow);
    background: rgba(15, 23, 42, 0.95);
}

.select-input:hover {
    border-color: var(--primary-light);
    transform: translateY(-1px);
}

.info-box {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(99, 102, 241, 0.1);
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: none;
}

.info-box.show {
    display: block;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Operation Tabs - Vertical Layout */
.operation-tabs {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tab-button {
    padding: 1rem 1.25rem;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(10px);
    border: 2px solid var(--card-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
}

.tab-button .icon {
    font-size: 1.25rem;
}

.tab-button .tab-label {
    flex: 1;
    text-align: left;
}

.tab-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.tab-button:hover::before {
    width: 300px;
    height: 300px;
}

.tab-button:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--primary-light);
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.tab-button.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md), var(--glow);
    transform: translateX(4px);
}

.tab-button.active::before {
    display: none;
}

/* Params Section */
.params-section {
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        max-height: 500px;
        transform: translateY(0);
    }
}

#paramsContent {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.param-group label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.param-input {
    padding: 0.875rem 1.25rem;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border: 2px solid var(--card-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.param-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15), var(--glow);
    background: rgba(15, 23, 42, 0.95);
}

.param-radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.param-radio-group label {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.2s;
}

.param-radio-group label:hover {
    background: rgba(99, 102, 241, 0.1);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.workspace-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Workspace Cards */
.workspace-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.workspace-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.5), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.workspace-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg), var(--glow);
    border-color: rgba(99, 102, 241, 0.4);
}

.workspace-card:hover::before {
    opacity: 1;
}

.workspace-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.workspace-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.workspace-icon {
    font-size: 1.5rem;
}

.workspace-title h3 {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.01em;
}

.workspace-body {
    flex: 1;
    padding: 2rem;
}

.workspace-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--card-border);
}

/* Textarea */
textarea {
    width: 100%;
    height: 100%;
    min-height: 300px;
    padding: 1.25rem;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border: 2px solid var(--card-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: 'Inter', 'Consolas', 'Monaco', monospace;
    line-height: 1.8;
    resize: vertical;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15), var(--glow);
    background: rgba(15, 23, 42, 0.95);
}

/* Output Text */
.output-text {
    min-height: 300px;
    padding: 1.25rem;
    background: rgba(15, 23, 42, 0.8);
    border: 2px solid var(--card-border);
    border-radius: 12px;
    font-family: 'Inter', 'Consolas', 'Monaco', monospace;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.8;
    transition: all 0.3s ease;
}

.output-text.success {
    border-color: var(--success-color);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

.output-text.error {
    border-color: var(--error-color);
    color: var(--error-color);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 280px;
    gap: 1rem;
}

.empty-icon {
    font-size: 3rem;
    opacity: 0.5;
}

.empty-state p {
    color: var(--text-tertiary);
    font-size: 1rem;
}

.extra-info {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(139, 92, 246, 0.1);
    border-left: 4px solid var(--secondary-color);
    border-radius: 8px;
    font-size: 0.875rem;
    display: none;
}

.extra-info.show {
    display: block;
    animation: slideIn 0.3s ease-out;
}

.extra-info strong {
    color: var(--secondary-color);
}

/* Buttons */
.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--glow);
}

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

.btn-large {
    width: 100%;
    padding: 1.25rem 2rem;
    font-size: 1.125rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(10px);
    border: 2px solid var(--card-border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1.125rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-icon:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary-light);
    transform: scale(1.1);
}

/* Spinner */
.spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.spinner-circle {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(99, 102, 241, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Brute Force Results */
.brute-force-results {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.brute-force-item {
    padding: 0.875rem;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.brute-force-item:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary-color);
    transform: translateX(4px);
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-tertiary);
    font-size: 0.875rem;
    border-top: 1px solid var(--card-border);
    background: rgba(15, 23, 42, 0.4);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .workspace-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 968px) {
    :root {
        --sidebar-width: 280px;
    }

    .nav-subtitle {
        display: none;
    }

    .brand-text {
        font-size: 1.25rem;
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        position: static;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--card-border);
    }

    .main-content {
        padding: 1.5rem;
    }

    .workspace-grid {
        gap: 1.5rem;
    }

    .workspace-header,
    .workspace-body,
    .workspace-footer {
        padding: 1.25rem 1.5rem;
    }
}