:root {
    --primary: #1e3a8a;
    --primary-dark: #1e40af;
    --secondary: #059669;
    --accent: #dc2626;
    --dark: #0f172a;
    --darker: #020617;
    --light: #f8fafc;
    --gray: #64748b;
    --gray-light: #e2e8f0;
    --gray-dark: #334155;
    --success: #059669;
    --error: #dc2626;
    --warning: #d97706;
    --border: #cbd5e1;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-lg: rgba(0, 0, 0, 0.25);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Tajawal', 'Arial', sans-serif;
}

body {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: var(--dark);
    min-height: 100vh;
    line-height: 1.6;
    font-size: 16px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.main-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 20px var(--shadow-lg);
    position: relative;
}

.header-top {
    background: rgba(0, 0, 0, 0.1);
    padding: 8px 0;
    font-size: 14px;
}

.header-info {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.header-info span {
    display: flex;
    align-items: center;
    gap: 5px;
    opacity: 0.9;
}

.header-main {
    padding: 30px 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.logo-icon {
    font-size: 3rem;
    color: white;
    display: block;
}

.title-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

.header-badges {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 12px 20px;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.badge:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Authentication Section */
.auth-section {
    padding: 40px 0;
}

.password-section {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 40px var(--shadow);
    border: 1px solid var(--border);
    max-width: 600px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 30px;
}

.section-header h2 {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-weight: 600;
}

.section-header p {
    color: var(--gray);
    font-size: 1rem;
}

.password-form {
    max-width: 400px;
    margin: 0 auto;
}

.password-input {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.password-input input {
    flex: 1;
    padding: 16px 20px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    background: var(--light);
    outline: none;
    transition: all 0.3s ease;
}

.password-input input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.password-input button {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px 24px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
}

.password-input button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 58, 138, 0.4);
}

.success-message, .error-message {
    padding: 15px;
    border-radius: 12px;
    display: none;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    animation: slideInUp 0.3s ease;
}

.success-message {
    background: #dcfce7;
    color: var(--success);
    border: 1px solid #bbf7d0;
}

.error-message {
    background: #fef2f2;
    color: var(--error);
    border: 1px solid #fecaca;
}

/* Main Application */
.translator-section {
    display: none;
    padding: 40px 0;
    animation: fadeIn 0.5s ease;
}

.system-status {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px var(--shadow);
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    border-radius: 10px;
    background: var(--light);
    min-width: 150px;
    transition: all 0.3s ease;
}

.status-item.active {
    background: #dcfce7;
    border: 1px solid #bbf7d0;
}

.status-item i {
    font-size: 1.5rem;
    color: var(--success);
}

.status-item h4 {
    font-size: 0.9rem;
    color: var(--gray-dark);
    margin-bottom: 2px;
}

.status-item span {
    font-size: 0.8rem;
    color: var(--success);
    font-weight: 600;
}

.translator-box {
    display: grid;
    gap: 30px;
}

.operation-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 30px var(--shadow);
    border: 1px solid var(--border);
}

.operation-section .section-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    text-align: right;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--gray-light);
}

.section-icon {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 15px rgba(30, 58, 138, 0.3);
}

.operation-section h3 {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 5px;
    font-weight: 600;
}

.operation-section .section-header p {
    color: var(--gray);
    font-size: 0.95rem;
}

.converter {
    background: var(--light);
    border-radius: 15px;
    padding: 25px;
    border: 1px solid var(--border);
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--gray-dark);
    font-weight: 600;
    font-size: 1rem;
}

textarea {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: white;
    color: var(--dark);
    font-size: 1rem;
    min-height: 120px;
    resize: vertical;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.btn-convert {
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 20px auto 0;
    transition: all 0.3s ease;
    min-width: 200px;
}

.btn-convert.primary {
    background: linear-gradient(135deg, var(--success) 0%, #047857 100%);
    box-shadow: 0 4px 15px rgba(5, 150, 105, 0.3);
}

.btn-convert.secondary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    box-shadow: 0 4px 15px rgba(30, 58, 138, 0.3);
}

.btn-convert:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

.result-container {
    margin-top: 25px;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: var(--gray-dark);
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.result {
    background: white;
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    min-height: 100px;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    line-height: 1.6;
    overflow-wrap: break-word;
    color: var(--dark);
}

.link-box {
    background: #eff6ff;
    border: 2px dashed var(--primary);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    display: none;
}

.link-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: var(--primary);
    font-weight: 600;
}

.link-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.link-content a {
    color: var(--primary);
    text-decoration: none;
    word-break: break-all;
    padding: 10px;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.link-content a:hover {
    text-decoration: underline;
}

.copy-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    align-self: flex-start;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* Footer */
.main-footer {
    background: var(--dark);
    color: white;
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    text-align: center;
}

.footer-section h4 {
    color: var(--gray-light);
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: 600;
}

.footer-section p {
    color: var(--gray);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .logo-section {
        flex-direction: column;
        gap: 15px;
    }
    
    .title-section h1 {
        font-size: 2rem;
    }
    
    .header-badges {
        justify-content: center;
    }
    
    .password-input {
        flex-direction: column;
    }
    
    .password-input button {
        width: 100%;
        justify-content: center;
    }
    
    .system-status {
        flex-direction: column;
    }
    
    .status-item {
        justify-content: center;
    }
    
    .operation-section .section-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .converter {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .password-section,
    .operation-section {
        padding: 25px 20px;
    }
    
    .title-section h1 {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .header-info {
        flex-direction: column;
        gap: 10px;
    }
}