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

:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --secondary: #6b7280;
    --secondary-dark: #4b5563;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-light: #334155;
    --border: #475569;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --success: #10b981;
    --success-light: #ecfdf5;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    background: linear-gradient(135deg, var(--background) 0%, #1a2f4d 100%);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeIn 0.6s ease-out;
}

header h1 {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 50%, #93c5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

header p {
    color: var(--text-secondary);
    font-size: 1.15rem;
    font-weight: 400;
    margin-bottom: 24px;
}

.security-info {
    margin-top: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.security-badge {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 12px;
    padding: 16px 24px;
    max-width: 500px;
    text-align: center;
    backdrop-filter: blur(10px);
}

.security-badge .lock-icon {
    font-size: 1.5rem;
    margin-right: 8px;
}

.security-badge strong {
    display: block;
    color: #10b981;
    font-size: 1.05rem;
    margin-bottom: 6px;
}

.security-badge p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.5;
}

.info-links {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.info-links a {
    padding: 10px 20px;
    background: var(--surface-light);
    color: var(--primary);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid var(--primary);
    transition: all 0.2s ease;
    cursor: pointer;
}

.info-links a:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.converter-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
    animation: slideUp 0.6s ease-out 0.1s both;
}

@media (max-width: 768px) {
    .converter-wrapper {
        grid-template-columns: 1fr;
    }
}

.input-section,
.output-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.section-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: var(--surface-light);
    padding: 4px 12px;
    border-radius: 20px;
}

textarea {
    width: 100%;
    min-height: 300px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'Courier New', 'Courier', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    resize: vertical;
    transition: all 0.2s ease;
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: #1e293b;
}

textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

textarea:read-only {
    background: var(--surface);
    cursor: default;
}

.button-group {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 24px;
    animation: slideUp 0.6s ease-out 0.2s both;
}

@media (max-width: 480px) {
    .button-group {
        flex-direction: column;
    }
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

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

.btn-secondary {
    background: var(--surface-light);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--border);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-secondary:active:not(:disabled) {
    background: var(--surface-light);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-tertiary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-tertiary:hover:not(:disabled) {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.btn-tertiary:active:not(:disabled) {
    background: var(--surface-light);
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    background: var(--success);
    color: white;
    border-radius: 8px;
    font-weight: 500;
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 1000;
}

.notification.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

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

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

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    max-width: 900px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

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

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.close-btn:hover {
    color: var(--text-primary);
}

.modal-body {
    flex: 1;
    overflow: auto;
    padding: 0;
}

.code-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    background: var(--surface-light);
    padding: 0;
    sticky: top 0;
    z-index: 100;
}

.code-tab {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 12px 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.code-tab:hover {
    color: var(--primary);
}

.code-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

#codeDisplay {
    margin: 0;
    padding: 20px;
    background: var(--surface);
    overflow: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-primary);
}

#codeDisplay code {
    background: none;
    padding: 0;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    header p {
        font-size: 1rem;
    }

    .security-badge {
        max-width: 100%;
    }

    .info-links {
        flex-direction: column;
        width: 100%;
    }

    .info-links a {
        width: 100%;
        text-align: center;
    }

    textarea {
        min-height: 250px;
    }

    .modal-content {
        max-height: 95vh;
        width: 95%;
    }
}
