/**
 * UI Components Styles
 * Styles for cards, buttons, modals, tables, forms, toasts, etc.
 */

/* Cards */
.card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s;
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.card-subtitle {
    font-size: 14px;
    color: #888;
    margin-top: 4px;
}

.card-content {
    color: #e6e6e6;
}

/* Stats Card */
.stats-card {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.1) 0%, rgba(74, 144, 226, 0.05) 100%);
    border: 1px solid rgba(74, 144, 226, 0.2);
}

.stats-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.stats-card-icon {
    font-size: 24px;
}

.stats-card-label {
    font-size: 13px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-card-value {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.stats-card-change {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
}

.stats-card-change.positive {
    color: #4caf50;
}

.stats-card-change.negative {
    color: #ff5252;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

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

.btn-primary {
    background: #4a90e2;
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: #357abd;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.btn-success {
    background: #4caf50;
    color: #fff;
}

.btn-success:hover:not(:disabled) {
    background: #388e3c;
}

.btn-danger {
    background: #ff5252;
    color: #fff;
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #e6e6e6;
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15);
}

.btn-ghost {
    background: transparent;
    color: #888;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-ghost:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.05);
    color: #e6e6e6;
}

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

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

.btn-full {
    width: 100%;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.2s;
}

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

.modal {
    background: #1a1d24;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: #888;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

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

.table th {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #e6e6e6;
}

.table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

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

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

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #e6e6e6;
    margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    transition: all 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: #4a90e2;
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-checkbox,
.form-radio {
    width: 18px;
    height: 18px;
    margin-right: 8px;
}

.form-helper {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

/* Toasts */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 3000;
}

.toast {
    background: #1a1d24;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 10px;
    min-width: 300px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: slideInRight 0.3s;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-message {
    font-size: 14px;
    color: #e6e6e6;
}

.toast-close {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: #888;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.toast.success {
    border-left: 3px solid #4caf50;
}

.toast.error {
    border-left: 3px solid #ff5252;
}

.toast.warning {
    border-left: 3px solid #ff9800;
}

.toast.info {
    border-left: 3px solid #4a90e2;
}

/* Loaders */
.loader {
    display: inline-block;
}

.loader-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: #4a90e2;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loader-dots {
    display: flex;
    gap: 6px;
}

.loader-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4a90e2;
    animation: bounce 1.4s infinite ease-in-out;
}

.loader-dot:nth-child(2) {
    animation-delay: -0.32s;
}

.loader-dot:nth-child(3) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Progress bar */
.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4a90e2, #5ba3f5);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: rgba(74, 144, 226, 0.2);
    color: #4a90e2;
}

.badge-success {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}

.badge-danger {
    background: rgba(255, 82, 82, 0.2);
    color: #ff5252;
}

.badge-warning {
    background: rgba(255, 152, 0, 0.2);
    color: #ff9800;
}

.badge-info {
    background: rgba(33, 150, 243, 0.2);
    color: #2196f3;
}

/* Utility classes */
.positive {
    color: #4caf50 !important;
}

.negative {
    color: #ff5252 !important;
}

.text-muted {
    color: #888 !important;
}

.text-center {
    text-align: center !important;
}

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

.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; }

.empty-state {
    padding: 60px 20px;
    text-align: center;
    color: #666;
    font-size: 14px;
}
