/* ==========================================
   E-İmza Uygulaması Stil Dosyası (Modern Koyu Tema)
   ========================================== */

:root {
    --bg-main: #0a0e17;
    --bg-card: rgba(20, 30, 48, 0.45);
    --border-color: rgba(255, 255, 255, 0.08);
    
    --color-primary: #3b82f6;
    --color-primary-hover: #2563eb;
    
    --color-success: #10b981;
    --color-success-hover: #059669;
    
    --color-danger: #ef4444;
    --color-warning: #f59e0b;
    
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
    background-image: radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.1) 0%, transparent 40%),
                      radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.08) 0%, transparent 40%);
}

.app-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* --- Sol Menü (Sidebar) --- */
.sidebar {
    width: 360px;
    background: rgba(13, 20, 35, 0.85);
    border-right: 1px solid var(--border-color);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    backdrop-filter: blur(20px);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 1.8rem;
    background: linear-gradient(135deg, var(--color-primary), var(--color-success));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-area h1 {
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff, #a1a1aa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- Kart Tasarımı (Glassmorphism) --- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(12px);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.card:hover {
    border-color: rgba(59, 130, 246, 0.25);
}

.card h2 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.2rem;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
}

/* --- Form Elemanları --- */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 1.2rem;
}

.input-group label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.input-group input[type="text"],
.input-group input[type="password"],
.input-group select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 14px;
    color: #ffffff;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s ease;
}

.input-group input:focus,
.input-group select:focus {
    border-color: var(--color-primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.input-group small {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* --- Toggle Switch (Açma/Kapama Sürgüsü) --- */
.switch-container {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.switch-container input {
    display: none;
}

.slider {
    position: relative;
    width: 44px;
    height: 22px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 34px;
    transition: .3s;
    border: 1px solid var(--border-color);
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    transition: .3s;
}

input:checked + .slider {
    background-color: var(--color-primary);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

.switch-label {
    font-size: 0.85rem;
    color: #ffffff;
    user-select: none;
}

/* --- Butonlar --- */
.btn {
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-outline {
    background: transparent;
    color: white;
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger-outline {
    background: rgba(239, 68, 68, 0.05);
    color: var(--color-danger);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.btn-danger-outline:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.45);
}

.btn-success {
    background: var(--color-success);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: var(--color-success-hover);
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-large {
    padding: 14px 28px;
    font-size: 1rem;
}

/* --- Sertifika Detay Kartı --- */
.cert-info {
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cert-info p {
    color: var(--text-muted);
}

.cert-info span {
    color: #ffffff;
    word-break: break-all;
}

.footer-info {
    margin-top: auto;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1rem;
}

/* --- Sağ Panel (Ana İçerik Alanı) --- */
.main-content {
    flex: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    overflow-y: auto;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-title h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.header-title p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Servis Durumu Göstergesi */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 20px;
}

.status-indicator .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--color-danger);
    box-shadow: 0 0 8px var(--color-danger);
    transition: all 0.3s ease;
}

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

.status-indicator .text {
    font-size: 0.8rem;
    font-weight: 500;
}

/* --- Dosya Sürükle Bırak Bölümü --- */
.upload-section {
    width: 100%;
}

.upload-box {
    border: 2px dashed rgba(59, 130, 246, 0.3);
    background: rgba(59, 130, 246, 0.02);
    border-radius: 16px;
    padding: 3rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.upload-box.dragover {
    border-color: var(--color-success);
    background: rgba(16, 185, 129, 0.05);
    transform: scale(1.01);
}

.upload-icon {
    font-size: 3rem;
}

.upload-box h3 {
    font-size: 1.2rem;
    font-weight: 600;
}

.upload-box p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.action-buttons {
    display: flex;
    gap: 12px;
}

/* --- İmza Seçenekleri Paneli --- */
.signature-options {
    background: linear-gradient(135deg, rgba(20, 30, 48, 0.6) 0%, rgba(13, 20, 35, 0.6) 100%);
}

.options-grid {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.options-grid .input-group {
    margin-bottom: 0;
    flex: 1;
}

.flex-end {
    display: flex;
    justify-content: flex-end;
}

/* --- Dosya Tablosu --- */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.badge {
    background: rgba(59, 130, 246, 0.15);
    color: var(--color-primary);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.table-container {
    width: 100%;
    overflow-x: auto;
}

.file-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.file-table th,
.file-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
}

.file-table th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.file-table tbody tr {
    transition: background-color 0.2s ease;
}

.file-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Durum Rozetleri */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-waiting {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.status-hash {
    background: rgba(245, 158, 11, 0.15);
    color: var(--color-warning);
}

.status-signing {
    background: rgba(59, 130, 246, 0.15);
    color: var(--color-primary);
}

.status-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--color-success);
}

.status-error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--color-danger);
}

/* --- Toast Bildirimleri --- */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.toast {
    background: rgba(13, 20, 35, 0.9);
    border: 1px solid var(--border-color);
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(12px);
    border-left: 4px solid var(--color-primary);
    padding: 12px 20px;
    border-radius: 8px;
    color: #ffffff;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    animation: slideIn 0.3s ease forwards;
}

.toast.toast-success {
    border-left-color: var(--color-success);
}

.toast.toast-error {
    border-left-color: var(--color-danger);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* --- Yardımcı Program İndirme Butonu Stilleri --- */
.download-agent-btn {
    text-decoration: none;
    width: 100%;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-success));
    border: none !important;
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2);
}

.download-agent-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.agent-guide-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

/* --- Modalı Görüntüleme Stilleri --- */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1100; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(6, 10, 18, 0.75); 
    backdrop-filter: blur(8px);
}

.modal-content {
    background-color: rgba(17, 24, 39, 0.95);
    border: 1px solid var(--border-color);
    margin: 4% auto; 
    padding: 2rem;
    width: 60%; 
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
}

.close-btn {
    color: var(--text-muted);
    font-size: 1.8rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
}

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

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.cert-summary-card {
    background: rgba(59, 130, 246, 0.04);
    border: 1px solid rgba(59, 130, 246, 0.15);
    padding: 1.2rem;
    border-radius: 12px;
}

.cert-summary-card h4,
.document-content-viewer h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    color: #ffffff;
}

.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    font-size: 0.85rem;
}

.summary-grid p {
    color: var(--text-muted);
}

.summary-grid span {
    color: #ffffff;
}

.document-content-viewer pre {
    background: rgba(6, 10, 18, 0.6);
    border: 1px solid var(--border-color);
    padding: 1.2rem;
    border-radius: 12px;
    max-height: 350px;
    overflow-y: auto;
    overflow-x: auto;
}

.document-content-viewer code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.8rem;
    color: #34d399;
    white-space: pre-wrap;
    word-break: break-all;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 1rem;
    margin-top: 1.5rem;
}

/* --- Giriş Ekranı (Login Screen) Stilleri --- */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-main);
    background-image: radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
                      radial-gradient(circle at 20% 80%, rgba(16, 185, 129, 0.08) 0%, transparent 45%);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1200;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.login-card {
    background: rgba(17, 24, 39, 0.75);
    border: 1px solid var(--border-color);
    padding: 3rem 2.5rem;
    border-radius: 20px;
    width: 440px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: fadeInDown 0.5s ease;
}

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

.login-logo {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.5rem;
}

.login-logo h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #ffffff;
}

.login-logo p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.login-btn {
    width: 100%;
    padding: 12px;
    font-size: 0.95rem;
    background: var(--color-primary);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.login-btn:hover {
    background: var(--color-primary-hover);
}

.login-info {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 0.8rem;
}

/* --- Çıkış Butonu Stili --- */
.logout-btn {
    width: 100%;
    margin-top: auto;
    margin-bottom: 0.5rem;
    border-color: rgba(239, 68, 68, 0.15) !important;
    color: var(--text-muted) !important;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.08) !important;
    border: 1px solid rgba(239, 68, 68, 0.35) !important;
    color: var(--color-danger) !important;
}

/* --- Kullanıcı Profil Kartı --- */
.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 0.5rem;
}

.user-profile-badge .avatar {
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border-color);
}

.user-details h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 2px;
}

.role-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.role-admin {
    background: rgba(59, 130, 246, 0.15);
    color: var(--color-primary);
}

.role-signer {
    background: rgba(16, 185, 129, 0.15);
    color: var(--color-success);
}

.role-viewer {
    background: rgba(245, 158, 11, 0.15);
    color: var(--color-warning);
}

/* --- Sekme Navigasyon Menüsü --- */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 0.5rem;
}

.nav-item {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: left;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: #ffffff;
}

.nav-item.active {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
    color: var(--color-primary);
    font-weight: 600;
}

/* --- Görünüm Paneli --- */
.view-panel {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 100%;
}

/* --- Ayarlar Sayfası Stilleri --- */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.settings-action {
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1.2rem;
}

/* --- Sağlık Bakanlığı Boyut Uyarısı Stilleri --- */
.toast.toast-warning {
    border-left-color: var(--color-warning);
}

.warning-icon-alert {
    display: inline-block;
    animation: pulseWarning 1.2s infinite alternate;
}

@keyframes pulseWarning {
    from {
        transform: scale(1);
        filter: drop-shadow(0 0 0 transparent);
    }
    to {
        transform: scale(1.2);
        filter: drop-shadow(0 0 5px var(--color-warning));
    }
}/* --- Rehber / Çalışma Mantığı Görünümü Stilleri --- */
.guide-steps-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1rem;
}

.guide-step-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    position: relative;
    transition: all 0.3s ease;
}

.guide-step-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(59, 130, 246, 0.25);
    transform: translateY(-2px);
}

.guide-step-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    color: #ffffff;
    padding-left: 28px;
}

.guide-step-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    padding-left: 28px;
}

.step-num {
    position: absolute;
    left: 1.5rem;
    top: 1.4rem;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-success));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

/* --- Kullanıcı Yönetimi Link Butonları --- */
.btn-danger-text {
    color: var(--color-danger);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}
.btn-danger-text:hover {
    background: rgba(239, 68, 68, 0.1);
}

.btn-primary-text {
    color: var(--color-primary);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}
.btn-primary-text:hover {
    background: rgba(59, 130, 246, 0.1);
}

.btn-success-text {
    color: var(--color-success);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}
.btn-success-text:hover {
    background: rgba(16, 185, 129, 0.1);
}

/* --- Sayfalama Stilleri --- */
.page-num-btn {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.page-num-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.page-num-btn.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}
