/**
 * Atlantis Trust - Unified Admin Module Styles
 * Replaces all individual admin_style.css files
 * Uses CSS variables from components.css for consistency
 */

/* Import base components if not already loaded */
@import url('../../assets/css/components.css');

/* === ADMIN CONTAINER === */
.admin-container {
    width: 100%;
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.admin-content {
    background: var(--background);
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
}

/* Mobile responsive */
@media (min-width: 640px) {
    .admin-content {
        padding: 2rem;
    }
}

/* === PAGE HEADERS === */
.admin-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}

.admin-header h2 {
    font-size: 1.875rem;
    line-height: 2.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

.admin-header p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.25rem;
    margin: 0;
}

/* === FORM CONTROLS === */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-select,
.form-input {
    width: 100%;
    padding: 0.625rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5rem;
    color: var(--text-primary);
    background-color: var(--background);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.form-select:focus,
.form-input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-select:disabled,
.form-input:disabled {
    background-color: var(--gray-100);
    cursor: not-allowed;
}

/* Responsive select */
.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* === BUTTONS (Using Component System) === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 500;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

/* Button variants */
.btn-primary {
    background-color: var(--primary-600);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-700);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

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

.btn-success:hover:not(:disabled) {
    background-color: var(--success-700);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

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

.btn-danger:hover:not(:disabled) {
    background-color: var(--error-700);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    background-color: var(--gray-200);
    color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--gray-300);
}

.btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    line-height: 1rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    line-height: 1.5rem;
}

/* Icon buttons */
.btn-icon {
    padding: 0.5rem;
    width: 2.5rem;
    height: 2.5rem;
}

/* === ADMIN TABLES (Using data-table from table-components.css) === */
.table-wrapper {
    margin-top: 1.5rem;
    overflow-x: auto;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Override/extend data-table for admin-specific needs */
.admin-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.admin-table thead {
    background: linear-gradient(135deg, var(--primary-50) 0%, var(--primary-100) 100%);
    position: sticky;
    top: 0;
    z-index: 10;
}

.admin-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.75rem;
    line-height: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.admin-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

.admin-table tbody tr:hover {
    background-color: var(--gray-50);
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

/* Mobile responsive table */
@media (max-width: 768px) {
    .admin-table thead {
        display: none;
    }

    .admin-table,
    .admin-table tbody,
    .admin-table tr,
    .admin-table td {
        display: block;
        width: 100%;
    }

    .admin-table tr {
        margin-bottom: 1rem;
        border: 1px solid var(--border);
        border-radius: 0.5rem;
        padding: 0.5rem;
        background-color: var(--background);
    }

    .admin-table td {
        padding: 0.5rem;
        text-align: right;
        border-bottom: 1px solid var(--border);
        position: relative;
        padding-left: 50%;
    }

    .admin-table td:last-child {
        border-bottom: none;
    }

    .admin-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 0.5rem;
        font-weight: 600;
        text-transform: uppercase;
        font-size: 0.75rem;
        color: var(--text-secondary);
    }
}

/* === UPDATE SECTIONS === */
.update-section {
    background-color: var(--primary-50);
    border: 1px solid var(--primary-100);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 0.5rem;
    animation: slideDown 0.3s ease;
}

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

.update-section h4 {
    font-size: 1rem;
    line-height: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
}

.update-form {
    display: grid;
    gap: 1rem;
}

@media (min-width: 640px) {
    .update-form {
        grid-template-columns: repeat(2, 1fr);
    }

    .update-form .form-group-full {
        grid-column: 1 / -1;
    }
}

/* === MESSAGE ALERTS === */
.message {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    display: none;
    animation: fadeIn 0.3s ease;
}

.message.show {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.message-success {
    background-color: var(--success-50);
    border-left: 4px solid var(--success-600);
    color: var(--success-700);
}

.message-error {
    background-color: var(--error-50);
    border-left: 4px solid var(--error-600);
    color: var(--error-700);
}

.message-warning {
    background-color: var(--warning-50);
    border-left: 4px solid var(--warning-600);
    color: var(--warning-700);
}

.message-info {
    background-color: var(--primary-50);
    border-left: 4px solid var(--primary-600);
    color: var(--primary-700);
}

/* === BADGE COMPONENTS === */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    line-height: 1rem;
    font-weight: 500;
    border-radius: 9999px;
}

.badge-success {
    background-color: var(--success-100);
    color: var(--success-700);
}

.badge-error {
    background-color: var(--error-100);
    color: var(--error-700);
}

.badge-warning {
    background-color: var(--warning-100);
    color: var(--warning-700);
}

.badge-info {
    background-color: var(--primary-100);
    color: var(--primary-700);
}

/* === LOADING STATES === */
.loading {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--border);
    border-radius: 50%;
    border-top-color: var(--primary-600);
    animation: spin 0.6s linear infinite;
}

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

.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 0.25rem;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* === EMPTY STATES === */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    color: var(--gray-300);
}

.empty-state h3 {
    font-size: 1.125rem;
    line-height: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.25rem;
    margin: 0;
}

/* === UTILITY CLASSES === */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.flex {
    display: flex;
}

.flex-wrap {
    flex-wrap: wrap;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

.hidden {
    display: none;
}

/* === RESPONSIVE UTILITIES === */
@media (max-width: 640px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 641px) {
    .show-mobile {
        display: none !important;
    }
}
