/**
 * Admin Panel Styles
 * Customized styles for the email marketing admin panel
 */

/* Base Styles */
body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f7fb;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.admin-footer {
    margin-top: auto;
}

/* Card Styling */
.card {
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    overflow: hidden;
}

.card-header {
    font-weight: 500;
    background-color: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1rem 1.25rem;
}

.card .table {
    margin-bottom: 0;
}

/* Feature Icons */
.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    font-size: 1.5rem;
    border-radius: 0.5rem;
}

/* Button Styling */
.btn {
    border-radius: 0.375rem;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.5rem;
    width: 2.5rem;
    border-radius: 50%;
}

/* Form Controls */
.form-control,
.form-select {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
}

.form-control:focus,
.form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Table Styling */
.table > :not(:first-child) {
    border-top: 1px solid #dee2e6;
}

.table-hover tbody tr:hover {
    background-color: #f8f9fa;
}

.table-actions {
    white-space: nowrap;
}

/* Dashboard Stats */
.stats-card {
    transition: transform 0.2s;
    cursor: pointer;
}

.stats-card:hover {
    transform: translateY(-5px);
}

.stats-card .card-value {
    font-size: 2rem;
    font-weight: 600;
}

/* Login and Authentication Pages */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f7fb;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

/* Nav Tabs */
.nav-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    color: #6c757d;
}

.nav-tabs .nav-link.active {
    border-bottom: 2px solid #0d6efd;
    color: #0d6efd;
    background-color: transparent;
}

/* Custom Switch */
.form-switch .form-check-input {
    width: 3em;
    margin-left: -3.5em;
}

.form-switch .form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

/* Confirmation dialog icon */
.icon-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 5rem;
    height: 5rem;
    border-radius: 50%;
    font-size: 2rem;
    margin: 0 auto;
}

/* File upload styling */
.file-upload-wrapper {
    position: relative;
    width: 100%;
    height: auto;
}

.file-upload-input {
    width: 100%;
    color: #495057;
    padding: 0.5rem 0.75rem;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
}

.file-upload-button {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    background-color: #0d6efd;
    color: white;
    border: none;
    border-radius: 0 0.375rem 0.375rem 0;
    padding: 0.5rem 1rem;
}

/* Responsive utilities */
@media (max-width: 767.98px) {
    .table-responsive-cards .card-table-row {
        display: block;
        width: 100%;
        margin-bottom: 1rem;
        border: 1px solid #dee2e6;
        border-radius: 0.375rem;
    }
    
    .table-responsive-cards td {
        display: block;
        text-align: right;
        border: none;
        position: relative;
        padding-left: 120px;
    }
    
    .table-responsive-cards td:before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 110px;
        font-weight: 600;
        text-align: left;
        padding-left: 0.75rem;
    }
}

/* CodeMirror customizations for email templates */
.CodeMirror {
    height: auto;
    min-height: 500px;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
}

.CodeMirror-focused {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Template preview frame */
.template-preview-frame {
    width: 100%;
    height: 600px;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
}

/* Template vars dropdown */
.template-vars-dropdown {
    margin-top: 0.5rem;
}

/* API keys display */
.api-key-display {
    font-family: Consolas, Monaco, 'Andale Mono', monospace;
    background-color: #f8f9fa;
    padding: 0.5rem;
    border-radius: 0.25rem;
    word-break: break-all;
}

/* Loading spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner-border-lg {
    width: 3rem;
    height: 3rem;
}
