/* ═══════════════════════════════════════════════════════════════
   GOTHIC THEME - Beget Mail Generator
   ═══════════════════════════════════════════════════════════════ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'EB Garamond', Georgia, serif;
    background: linear-gradient(135deg, #050505 0%, #0b0b0b 50%, #070707 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: #e6e6e6;
    position: relative;
    overflow-x: hidden;
}

/* Gothic background pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(255, 255, 255, 0.02) 2px, rgba(255, 255, 255, 0.02) 4px),
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255, 255, 255, 0.02) 2px, rgba(255, 255, 255, 0.02) 4px);
    pointer-events: none;
    z-index: 0;
}

/* ═══════════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════════ */

.gothic-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.main-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 24px;
}

.left-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.right-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ═══════════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════════ */

.gothic-header {
    text-align: center;
    padding: 30px 0;
    position: relative;
}

.gothic-header h1 {
    font-family: 'UnifrakturMaguntia', 'Cinzel', serif;
    font-size: 3.5em;
    font-weight: 400;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.08);
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.gothic-header .subtitle {
    font-family: 'Cinzel', serif;
    font-size: 1em;
    color: #a0a0a0;
    text-transform: uppercase;
    letter-spacing: 4px;
    font-style: normal;
}

.connection-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(15, 15, 15, 0.9);
    border: 1px solid #3a3a3a;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #666;
    animation: pulse 2s infinite;
}

.connection-badge.connected .status-dot {
    background: #4ade80;
    box-shadow: 0 0 8px #4ade80;
}

.connection-badge.error .status-dot {
    background: #ef4444;
    box-shadow: 0 0 8px #ef4444;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ═══════════════════════════════════════════════════════════════
   DIVIDER & ORNAMENT
   ═══════════════════════════════════════════════════════════════ */

.divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, #3a3a3a, transparent);
    margin: 20px 0;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.05);
}

.ornament {
    text-align: center;
    color: #3a3a3a;
    font-size: 18px;
    margin: 30px 0;
    letter-spacing: 12px;
}

/* ═══════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════════ */

.gothic-card {
    background: linear-gradient(135deg, rgba(12, 12, 12, 0.95) 0%, rgba(16, 16, 16, 0.95) 100%);
    border: 1px solid #2e2e2e;
    box-shadow:
        0 0 40px rgba(0, 0, 0, 0.7),
        inset 0 0 20px rgba(255, 255, 255, 0.03);
    position: relative;
}

.gothic-card::before {
    content: '✦';
    position: absolute;
    top: -10px;
    left: 15px;
    font-size: 14px;
    color: #4a4a4a;
}

.gothic-card::after {
    content: '✦';
    position: absolute;
    top: -10px;
    right: 15px;
    font-size: 14px;
    color: #4a4a4a;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #1a1a1a 0%, #141414 100%);
    border-bottom: 1px solid #2e2e2e;
    font-family: 'Cinzel', serif;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #ffffff;
}

.card-header-dark {
    background: linear-gradient(135deg, #0f0f0f 0%, #0a0a0a 100%);
}

.card-header-success {
    background: linear-gradient(135deg, #0f1a0f 0%, #0a140a 100%);
    border-bottom-color: #1a3a1a;
}

.header-icon {
    margin-right: 10px;
    font-size: 16px;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.card-body {
    padding: 20px;
}

.card-body.p-0 {
    padding: 0;
}

.actions-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ═══════════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════════ */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-family: 'Cinzel', serif;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #c0c0c0;
}

.form-group label i {
    margin-right: 6px;
    opacity: 0.7;
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #707070;
    font-style: italic;
}

.gothic-input,
.gothic-select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(15, 15, 15, 0.9);
    border: 1px solid #3a3a3a;
    color: #e8e8e8;
    font-family: 'EB Garamond', serif;
    font-size: 16px;
    transition: all 0.3s ease;
}

.gothic-input::placeholder {
    color: #606060;
}

.gothic-input:focus,
.gothic-select:focus {
    outline: none;
    border-color: #5a5a5a;
    background: rgba(18, 18, 18, 0.95);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.06), inset 0 0 5px rgba(255, 255, 255, 0.03);
}

.gothic-select option {
    background: #1a1a1a;
    color: #e8e8e8;
}

.gothic-input-sm,
.gothic-select-sm {
    padding: 8px 12px;
    font-size: 14px;
}

.gothic-textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(10, 10, 10, 0.9);
    border: 1px solid #2a2a2a;
    color: #e8e8e8;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 13px;
    resize: vertical;
    min-height: 120px;
}

.gothic-textarea:focus {
    outline: none;
    border-color: #4a4a4a;
}

.gothic-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    appearance: none;
    border: 1px solid #3a3a3a;
    background: rgba(15, 15, 15, 0.9);
    transition: all 0.2s;
}

.gothic-checkbox:hover {
    border-color: #5a5a5a;
}

.gothic-checkbox:checked {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border-color: #5a5a5a;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23ffffff' d='M13.78 4.22a.75.75 0 010 1.06l-7.5 7.5a.75.75 0 01-1.06 0l-3.75-3.75a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100%;
}

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════ */

.gothic-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: 1px solid #4a4a4a;
    background: linear-gradient(135deg, #1e1e1e 0%, #141414 100%);
    color: #ffffff;
    font-family: 'Cinzel', serif;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.gothic-btn:hover {
    background: linear-gradient(135deg, #2a2a2a 0%, #1b1b1b 100%);
    border-color: #6a6a6a;
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.06), inset 0 0 8px rgba(255, 255, 255, 0.04);
}

.gothic-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.gothic-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.gothic-btn-primary {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%);
    border-color: #5a5a5a;
}

.gothic-btn-primary:hover {
    background: linear-gradient(135deg, #252525 0%, #151515 100%);
    border-color: #7a7a7a;
}

.gothic-btn-secondary {
    width: 100%;
    background: rgba(20, 20, 20, 0.8);
    border-color: #3a3a3a;
    font-size: 13px;
}

.gothic-btn-secondary:hover {
    background: rgba(30, 30, 30, 0.9);
    border-color: #5a5a5a;
}

.gothic-btn-danger {
    border-color: #5a2a2a;
    background: linear-gradient(135deg, #2a1515 0%, #1a0f0f 100%);
}

.gothic-btn-danger:hover {
    border-color: #8a3a3a;
    background: linear-gradient(135deg, #3a1a1a 0%, #2a1010 100%);
}

.gothic-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid #3a3a3a;
    color: #a0a0a0;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.gothic-btn-icon:hover {
    background: rgba(35, 35, 35, 0.9);
    border-color: #5a5a5a;
    color: #ffffff;
}

.gothic-btn-icon:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.gothic-btn-icon.gothic-btn-danger:hover {
    background: rgba(60, 20, 20, 0.9);
    border-color: #6a3a3a;
    color: #ff9999;
}

.gothic-btn-icon.gothic-btn-success:hover {
    background: rgba(20, 40, 20, 0.9);
    border-color: #3a6a3a;
    color: #99ff99;
}

.gothic-btn-icon.gothic-btn-light {
    border-color: #4a4a4a;
}

/* ═══════════════════════════════════════════════════════════════
   TABLE
   ═══════════════════════════════════════════════════════════════ */

.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(18, 18, 18, 0.6);
    border-bottom: 1px solid #2a2a2a;
}

.filter-bar .gothic-select {
    width: auto;
    min-width: 150px;
}

.filter-bar .gothic-input {
    flex: 1;
    max-width: 250px;
}

.filter-count {
    margin-left: auto;
    font-size: 12px;
    color: #808080;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.table-wrapper {
    max-height: 450px;
    overflow-y: auto;
}

.table-wrapper::-webkit-scrollbar {
    width: 8px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: #0a0a0a;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: #3a3a3a;
    border-radius: 0;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #4a4a4a;
}

.gothic-table {
    width: 100%;
    border-collapse: collapse;
}

.gothic-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.gothic-table th {
    padding: 12px 16px;
    background: linear-gradient(135deg, #1a1a1a 0%, #141414 100%);
    border-bottom: 1px solid #3a3a3a;
    font-family: 'Cinzel', serif;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #a0a0a0;
    text-align: left;
}

.gothic-table .th-checkbox {
    width: 50px;
    text-align: center;
}

.gothic-table .th-actions {
    width: 120px;
    text-align: center;
}

.gothic-table td {
    padding: 12px 16px;
    background: rgba(14, 14, 14, 0.6);
    border-bottom: 1px solid #1a1a1a;
    font-size: 14px;
    color: #d0d0d0;
    transition: background 0.2s;
}

.gothic-table tr:hover td {
    background: rgba(25, 25, 25, 0.8);
}

.gothic-table .email-cell {
    font-family: 'Consolas', monospace;
    color: #ffffff;
}

.gothic-table .password-cell {
    font-family: 'Consolas', monospace;
    color: #a0a0a0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gothic-table .date-cell {
    font-size: 12px;
    color: #707070;
}

.gothic-table .actions-cell {
    text-align: center;
}

.gothic-table .actions-cell button {
    padding: 6px 10px;
    font-size: 12px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #606060;
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-family: 'EB Garamond', serif;
    font-size: 16px;
    font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════
   PROGRESS
   ═══════════════════════════════════════════════════════════════ */

.progress-container {
    margin-top: 20px;
}

.progress-container.d-none {
    display: none;
}

.gothic-progress {
    height: 24px;
    background: rgba(15, 15, 15, 0.9);
    border: 1px solid #3a3a3a;
    overflow: hidden;
}

.gothic-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #2a2a2a 0%, #3a3a3a 50%, #2a2a2a 100%);
    background-size: 200% 100%;
    animation: progressPulse 1.5s ease-in-out infinite;
    transition: width 0.3s ease;
}

@keyframes progressPulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.progress-text {
    text-align: center;
    margin-top: 10px;
    font-size: 13px;
    color: #808080;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ═══════════════════════════════════════════════════════════════
   STATS
   ═══════════════════════════════════════════════════════════════ */

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    text-align: center;
}

.stat-item {
    padding: 10px;
    background: rgba(18, 18, 18, 0.5);
    border: 1px solid #2a2a2a;
}

.stat-number {
    font-family: 'Cinzel', serif;
    font-size: 32px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 11px;
    color: #808080;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* ═══════════════════════════════════════════════════════════════
   RESULTS
   ═══════════════════════════════════════════════════════════════ */

.results-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
}

.result-success {
    color: #6ade80;
}

.result-error {
    color: #ef6464;
}

.result-success i,
.result-error i {
    margin-right: 6px;
}

/* ═══════════════════════════════════════════════════════════════
   ALERTS
   ═══════════════════════════════════════════════════════════════ */

#alertsContainer {
    margin-bottom: 20px;
}

.gothic-alert {
    padding: 14px 20px;
    margin-bottom: 12px;
    border: 1px solid #3a3a3a;
    background: rgba(18, 18, 18, 0.95);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gothic-alert-success {
    border-color: #2a4a2a;
    background: rgba(15, 25, 15, 0.95);
}

.gothic-alert-error {
    border-color: #4a2a2a;
    background: rgba(25, 15, 15, 0.95);
}

.gothic-alert-info {
    border-color: #2a3a4a;
    background: rgba(15, 20, 25, 0.95);
}

.gothic-alert .alert-icon {
    font-size: 18px;
}

.gothic-alert-success .alert-icon { color: #6ade80; }
.gothic-alert-error .alert-icon { color: #ef6464; }
.gothic-alert-info .alert-icon { color: #64a0ef; }

.gothic-alert .alert-message {
    flex: 1;
    font-size: 14px;
}

.gothic-alert .alert-close {
    background: none;
    border: none;
    color: #808080;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.gothic-alert .alert-close:hover {
    color: #ffffff;
}

/* ═══════════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════════ */

.gothic-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.gothic-modal.show {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.gothic-modal .modal-content {
    position: relative;
    width: 480px;
    max-width: 90vw;
    background: linear-gradient(135deg, #111111 0%, #0a0a0a 100%);
    border: 1px solid #3a3a3a;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.9);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.gothic-modal .modal-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #2a1515 0%, #1a0f0f 100%);
    border-bottom: 1px solid #4a2a2a;
    font-family: 'Cinzel', serif;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #ffffff;
}

.gothic-modal .modal-body {
    padding: 24px 20px;
}

.gothic-modal .modal-body p {
    margin-bottom: 12px;
    line-height: 1.6;
}

.gothic-modal .warning-text {
    color: #ef6464;
}

.gothic-modal .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(10, 10, 10, 0.5);
    border-top: 1px solid #2a2a2a;
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════ */

.gothic-footer {
    text-align: center;
    padding: 30px 20px;
    margin-top: 30px;
    border-top: 1px solid #2a2a2a;
    font-size: 13px;
    color: #606060;
}

.gothic-footer .footer-icon {
    margin-right: 8px;
    color: #4a4a4a;
}

.gothic-footer a {
    color: #808080;
    text-decoration: none;
    transition: color 0.2s;
}

.gothic-footer a:hover {
    color: #ffffff;
}

/* ═══════════════════════════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════════════════════════ */

.d-none {
    display: none !important;
}

.text-center {
    text-align: center;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
    .main-grid {
        grid-template-columns: 1fr;
    }

    .left-column {
        order: 2;
    }

    .right-column {
        order: 1;
    }

    .gothic-header h1 {
        font-size: 2.5em;
    }

    .connection-badge {
        position: static;
        display: inline-flex;
        margin-top: 16px;
    }
}

@media (max-width: 768px) {
    .gothic-container {
        padding: 12px;
    }

    .gothic-header h1 {
        font-size: 2em;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-bar .gothic-select,
    .filter-bar .gothic-input {
        width: 100%;
        max-width: none;
    }

    .filter-count {
        text-align: center;
        margin-left: 0;
        margin-top: 8px;
    }

    .header-actions {
        flex-wrap: wrap;
    }

    .gothic-table th,
    .gothic-table td {
        padding: 10px 12px;
        font-size: 13px;
    }

    .stats-grid {
        gap: 12px;
    }

    .stat-number {
        font-size: 26px;
    }
}

@media (max-width: 480px) {
    .gothic-header h1 {
        font-size: 1.6em;
    }

    .gothic-header .subtitle {
        font-size: 0.85em;
        letter-spacing: 2px;
    }

    .results-stats {
        flex-direction: column;
        gap: 8px;
    }
}
