/**
 * House Fluent Admin UI Styles
 *
 * Brand Colors:
 * - Midnight Blue: #174477
 * - Sea Green: #37B44A
 * - Slate Gray: #767B86
 */

:root {
    --primary-blue: #174477;
    --primary-green: #37B44A;
    --slate-gray: #767B86;
    --light-gray: #f5f5f5;
    --border-gray: #e0e0e0;
    --text-dark: #333333;
    --text-light: #666666;
    --white: #ffffff;
    --error-red: #dc3545;
    --success-green: #28a745;
    --warning-yellow: #ffc107;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--light-gray);
}

/* Authentication Pages Layout */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--slate-gray) 100%);
}

.auth-card {
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 100%;
    max-width: 450px;
}

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

.auth-logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 20px;
}

.auth-title {
    color: var(--primary-blue);
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.auth-subtitle {
    color: var(--text-light);
    font-size: 14px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 14px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-gray);
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(23, 68, 119, 0.1);
}

.form-input.error {
    border-color: var(--error-red);
}

.form-help {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-light);
}

.form-error {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: var(--error-red);
}

/* Code Input (for verification) */
.code-input-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 30px 0;
}

.code-digit {
    width: 50px;
    height: 60px;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    border: 2px solid var(--border-gray);
    border-radius: 8px;
    transition: all 0.2s;
}

.code-digit:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(23, 68, 119, 0.1);
}

.code-digit.filled {
    border-color: var(--primary-green);
    background-color: rgba(55, 180, 74, 0.05);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

.btn-primary:hover:not(:disabled) {
    background-color: #0f3159;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background-color: var(--slate-gray);
    color: var(--white);
}

.btn-secondary:hover:not(:disabled) {
    background-color: #5a5f6a;
}

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

.btn-success:hover:not(:disabled) {
    background-color: #2c9239;
}

.btn-danger {
    background-color: var(--error-red);
    color: var(--white);
}

.btn-danger:hover:not(:disabled) {
    background-color: #c82333;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 18px;
}

/* Alert Messages */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.alert-warning {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn .spinner {
    margin-right: 8px;
    vertical-align: middle;
}

/* Admin Layout */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 250px;
    background-color: var(--primary-blue);
    color: var(--white);
    padding: 20px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

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

.admin-sidebar-logo {
    max-width: 100%;
    height: auto;
    max-height: 60px;
    display: block;
}

.admin-nav {
    list-style: none;
}

.admin-nav-item {
    margin: 4px 0;
}

.admin-nav-link {
    display: block;
    padding: 12px 20px;
    color: var(--white);
    text-decoration: none;
    transition: background-color 0.2s;
}

.admin-nav-link:hover,
.admin-nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
}

.admin-main {
    flex: 1;
    margin-left: 250px;
    padding: 30px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-gray);
}

.admin-title {
    font-size: 28px;
    color: var(--primary-blue);
    font-weight: 600;
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.admin-user-name {
    font-weight: 500;
    color: var(--text-dark);
}

.admin-user-role {
    font-size: 13px;
    color: var(--text-light);
    text-transform: uppercase;
}

/* Content Cards */
.card {
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 24px;
    margin-bottom: 20px;
}

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

.card-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-blue);
}

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

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-gray);
}

.table th {
    background-color: var(--light-gray);
    font-weight: 600;
    color: var(--text-dark);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tr:hover {
    background-color: rgba(23, 68, 119, 0.02);
}

.table-actions {
    display: flex;
    gap: 8px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 14px;
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-draft {
    background-color: var(--slate-gray);
    color: var(--white);
}

.badge-published {
    background-color: var(--primary-green);
    color: var(--white);
}

.badge-archived {
    background-color: var(--text-light);
    color: var(--white);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.empty-state-text {
    font-size: 14px;
    margin-bottom: 20px;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.hidden { display: none; }

/* Responsive */
@media (max-width: 768px) {
    .admin-sidebar {
        width: 100%;
        position: static;
        height: auto;
    }

    .admin-main {
        margin-left: 0;
        padding: 20px;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .code-digit {
        width: 40px;
        height: 50px;
        font-size: 20px;
    }
}
