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

:root {
    --primary-color: #fb015b;
    --primary-hover: #d9014d;
    --bg-dark: #222;
    --bg-darker: #1a1a1a;
    --text-primary: #fff;
    --text-secondary: #b8b8b8;
    --text-muted: #737373;
    --border-color: #404040;
    --encoded-bg: #2d2d2d;
    --decoded-bg: #1e1e1e;
    --success-color: #00d084;
    --error-color: #fb015b;
    --warning-color: #fbba15;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell,
        sans-serif;
    background: var(--bg-darker);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Navbar */
.navbar {
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border-color);
    padding: 0;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
}

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

.brand-text {
    background: linear-gradient(135deg, var(--primary-color), #fb5d9a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: var(--text-primary);
    background: rgba(251, 1, 91, 0.1);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #222 0%, #1a1a1a 100%);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 2rem;
}

.hero-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hero h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    background: linear-gradient(135deg, var(--primary-color), #fb5d9a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
    margin-left: auto;
}

/* Main Container */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Controls Bar */
.controls-bar {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

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

.input-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-field {
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
    transition: all 0.2s;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(251, 1, 91, 0.1);
}

.input-field::placeholder {
    color: var(--text-muted);
}

/* Decoder Grid */
.decoder-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.panel {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.panel-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.panel-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.panel-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem 0.875rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.action-btn:active {
    transform: scale(0.95);
}

.action-btn svg {
    flex-shrink: 0;
}

.action-btn.success {
    color: var(--success-color);
    border-color: var(--success-color);
}

.panel-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.panel-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.encoded-panel .panel-content {
    background: var(--encoded-bg);
}

.decoded-panel .panel-content {
    background: var(--decoded-bg);
}

/* Code Textarea */
.code-textarea {
    flex: 1;
    width: 100%;
    min-height: 400px;
    background: transparent;
    border: none;
    padding: 1.5rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
    line-height: 1.6;
    resize: vertical;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow-x: hidden;
}

.code-textarea:focus {
    outline: none;
}

.code-textarea::placeholder {
    color: var(--text-muted);
}

/* Decoded Section */
.decoded-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid var(--border-color);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
}

.section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.decoded-output {
    min-height: 300px;
}

/* Signature Section */
.signature-section {
    background: rgba(255, 255, 255, 0.02);
}

.verification-content {
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-muted);
    flex-shrink: 0;
    transition: all 0.3s;
    margin-top: 0.425rem;
}

.status-indicator.success {
    background: var(--success-color);
    box-shadow: 0 0 8px var(--success-color);
}

.status-indicator.error {
    background: var(--error-color);
    box-shadow: 0 0 8px var(--error-color);
}

.status-indicator.warning {
    background: var(--warning-color);
    box-shadow: 0 0 8px var(--warning-color);
}

.status-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.status-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.pc-text {
    display: none;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.pc-label {
    color: var(--text-muted);
    min-width: 55px;
}

.pc-text .pc-value {
    font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.3);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    flex: 1;
}

.digest-text {
    display: none;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.digest-label {
    color: var(--text-muted);
    min-width: 55px;
}

.digest-text code {
    font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.3);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    flex: 1;
}

/* Error Banner */
.error-banner {
    background: rgba(251, 1, 91, 0.1);
    border: 1px solid var(--error-color);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.error-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.error-text {
    color: var(--text-primary);
    font-size: 0.95rem;
}

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

::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

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

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Footer */
.footer {
    background: rgba(42, 42, 42, 0.8);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 4rem;
    padding: 2.5rem 2rem;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

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

.brand-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-color), #d9014d);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: white;
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.footer-copyright {
    color: var(--text-muted);
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    text-align: center;
    flex: 1;
}

.footer-social {
    display: flex;
    gap: 1rem;
}

.social-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.social-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

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

    .hero {
        padding: 1.25rem 1rem;
    }

    .hero-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .hero h1 {
        font-size: 1.25rem;
    }

    .hero p {
        margin-left: 0;
        font-size: 0.85rem;
    }

    .nav-container {
        padding: 1rem;
    }

    .footer-container {
        flex-direction: column;
        text-align: center;
    }

    .footer-copyright {
        order: 2;
    }

    .footer-social {
        order: 1;
    }
}
