/* ============================================================
   MailVerify - Email Doğrulama Platformu Stil Dosyası
   ============================================================ */

:root {
    --primary: #4F46E5;
    --primary-dark: #4338CA;
    --primary-light: #EEF2FF;
    --success: #059669;
    --success-light: #ECFDF5;
    --danger: #DC2626;
    --danger-light: #FEF2F2;
    --warning: #D97706;
    --warning-light: #FFFBEB;
    --info: #2563EB;
    --info-light: #EFF6FF;
    
    --bg: #F3F4F6;
    --bg-card: #FFFFFF;
    --text: #111827;
    --text-secondary: #6B7280;
    --border: #E5E7EB;
    --border-light: #F3F4F6;
    
    --sidebar-width: 260px;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 6px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06);
    
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================
   Layout
   ============================================================ */
.app {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: #1F2937;
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-size: 20px;
    font-weight: 700;
    text-decoration: none;
}
.brand-link:hover { text-decoration: none; opacity: 0.9; }

.brand-icon { font-size: 28px; }

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    transition: all 0.2s;
    text-decoration: none;
    border-left: 3px solid transparent;
}
.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: white;
    text-decoration: none;
}
.nav-item.active {
    background: rgba(79,70,229,0.3);
    color: white;
    border-left-color: var(--primary);
}

.nav-icon { font-size: 16px; width: 24px; text-align: center; }

.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
}

.user-role {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
}

.logout-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background 0.2s;
}
.logout-btn:hover { background: rgba(220,38,38,0.6); text-decoration: none; }

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 30px;
    min-height: 100vh;
}

.mobile-toggle {
    display: none;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 200;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    padding: 8px 12px;
    font-size: 20px;
    cursor: pointer;
}

/* ============================================================
   Cards
   ============================================================ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    overflow: hidden;
}

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

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.card-header .card-filters {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ============================================================
   Page Header
   ============================================================ */
.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

/* ============================================================
   Stats Grid
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stats-secondary {
    grid-template-columns: repeat(3, 1fr);
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-icon { font-size: 28px; margin-bottom: 8px; }

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
}

.stat-value.large { font-size: 32px; }

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.progress-bar {
    margin-top: 10px;
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.progress-fill.green { background: var(--success); }
.progress-fill.blue { background: var(--info); }

/* ============================================================
   Quick Actions
   ============================================================ */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.action-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: var(--text);
    border: 2px solid transparent;
}
.action-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
    text-decoration: none;
}

.action-icon { font-size: 36px; display: block; margin-bottom: 10px; }
.action-label { font-weight: 600; font-size: 16px; display: block; margin-bottom: 4px; }
.action-desc { font-size: 13px; color: var(--text-secondary); }

/* ============================================================
   Forms
   ============================================================ */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: var(--font);
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

.form-group textarea {
    resize: vertical;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 13px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-grid {
    padding: 20px;
}

.form-inline {
    display: flex;
    gap: 16px;
    padding: 20px;
    align-items: flex-end;
}

.flex-grow { flex: 1; }

.form-input-sm {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon .input-icon {
    position: absolute;
    left: 12px;
    font-size: 16px;
}

.input-with-icon input {
    padding-left: 38px !important;
}

.toggle-password {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-family: var(--font);
}

.btn:hover { text-decoration: none; }

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

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

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #B91C1C; }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 16px; }
.btn-block { width: 100%; }

/* ============================================================
   Tables
   ============================================================ */
.table-responsive { overflow-x: auto; }

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--border-light);
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: 10px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--border-light);
}

.table tbody tr:hover {
    background: #F9FAFB;
}

.table .row-danger {
    background: var(--danger-light);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-sent { background: var(--info-light); color: var(--info); }
.badge-failed { background: var(--danger-light); color: var(--danger); }
.badge-bounced { background: var(--warning-light); color: var(--warning); }
.badge-delivered { background: #ECFDF5; color: #059669; }
.badge-opened { background: #F3E8FF; color: #7C3AED; }
.badge-spam { background: var(--danger-light); color: var(--danger); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-error { background: var(--danger-light); color: var(--danger); }

/* ============================================================
   Alerts
   ============================================================ */
.alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-success { background: var(--success-light); color: var(--success); border: 1px solid #A7F3D0; }
.alert-error { background: var(--danger-light); color: var(--danger); border: 1px solid #FECACA; }
.alert-warning { background: var(--warning-light); color: var(--warning); border: 1px solid #FDE68A; }
.alert-info { background: var(--info-light); color: var(--info); border: 1px solid #BFDBFE; }

.alert-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
}
.alert-close:hover { opacity: 1; }

/* ============================================================
   Auth Pages
   ============================================================ */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.auth-card {
    background: white;
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-icon { font-size: 48px; display: block; margin-bottom: 10px; }

.auth-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
}

.auth-desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

.auth-form { margin-bottom: 20px; }

.auth-footer {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
}

/* ============================================================
   DNS Results
   ============================================================ */
.dns-results { padding: 20px; }

.dns-item {
    padding: 16px;
    border-radius: var(--radius);
    margin-bottom: 12px;
    border: 1px solid var(--border);
}

.dns-item.pass { border-left: 4px solid var(--success); }
.dns-item.fail { border-left: 4px solid var(--danger); }

.dns-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.dns-status-icon { font-size: 16px; }

.dns-score {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--border-light);
    padding: 2px 8px;
    border-radius: 10px;
}

.dns-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.dns-record {
    display: block;
    padding: 8px 12px;
    background: #1F2937;
    color: #10B981;
    border-radius: 6px;
    font-size: 12px;
    word-break: break-all;
    font-family: 'Monaco', 'Menlo', monospace;
    overflow-x: auto;
}

.mx-list {
    list-style: none;
    padding: 0;
}

.mx-list li {
    padding: 4px 0;
    font-size: 14px;
    font-family: monospace;
}

/* Score Badge */
.score-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.score-badge.good { background: var(--success-light); color: var(--success); }
.score-badge.medium { background: var(--warning-light); color: var(--warning); }
.score-badge.bad { background: var(--danger-light); color: var(--danger); }

/* ============================================================
   Blacklist
   ============================================================ */
.bl-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 20px;
}

.bl-stat {
    text-align: center;
    padding: 16px;
    background: var(--border-light);
    border-radius: var(--radius);
}

.bl-stat.danger { background: var(--danger-light); }
.bl-stat.success { background: var(--success-light); }

.bl-stat-value {
    font-size: 24px;
    font-weight: 700;
}

.bl-stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ============================================================
   SMTP List
   ============================================================ */
.smtp-list { padding: 0; }

.smtp-item {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
}

.smtp-item:last-child { border-bottom: none; }

.smtp-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.smtp-item-name {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.active { background: var(--success); }
.status-dot.inactive { background: var(--danger); }

.smtp-item-actions { display: flex; gap: 6px; }

.smtp-item-details {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ============================================================
   Modal
   ============================================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: var(--radius);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

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

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
}

/* ============================================================
   Tips
   ============================================================ */
.tips-list { padding: 20px; }

.tip-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

.tip-item:last-child { border-bottom: none; }

.tip-item strong { font-size: 14px; }
.tip-item p { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

/* ============================================================
   API Docs
   ============================================================ */
.api-key-box {
    padding: 20px;
}

.api-key-display {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.api-key-display code {
    flex: 1;
    padding: 10px 14px;
    background: #1F2937;
    color: #FBBF24;
    border-radius: 6px;
    font-size: 14px;
    word-break: break-all;
}

.api-endpoint {
    border-bottom: 1px solid var(--border-light);
}

.api-endpoint:last-child { border-bottom: none; }

.endpoint-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: var(--border-light);
}

.method {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: white;
}

.method.post { background: #059669; }
.method.get { background: #2563EB; }

.endpoint-header code {
    font-size: 14px;
    font-weight: 600;
}

.endpoint-label {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-secondary);
}

.endpoint-body {
    padding: 20px;
}

.endpoint-body h4 {
    font-size: 13px;
    margin: 14px 0 6px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.endpoint-body pre {
    background: #1F2937;
    color: #E5E7EB;
    padding: 14px;
    border-radius: 6px;
    font-size: 13px;
    overflow-x: auto;
    line-height: 1.5;
}

.endpoint-body pre code {
    color: inherit;
    background: none;
    padding: 0;
}

/* ============================================================
   Empty State
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state.small { padding: 30px 20px; }

.empty-icon { font-size: 48px; margin-bottom: 12px; }

.empty-state h2 {
    font-size: 18px;
    margin-bottom: 6px;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* ============================================================
   Utilities
   ============================================================ */
.text-muted { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-center { text-align: center; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .quick-actions {
        grid-template-columns: 1fr;
    }
    .bl-summary {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 20px 16px;
    }
    
    .mobile-toggle {
        display: block;
    }
    
    .stats-grid,
    .stats-secondary {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-inline {
        flex-direction: column;
    }
    
    .bl-summary {
        grid-template-columns: 1fr;
    }
    
    .page-header h1 {
        font-size: 20px;
    }
    
    .endpoint-header {
        flex-wrap: wrap;
    }
    
    .smtp-item-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .smtp-item-actions {
        width: 100%;
    }
}