/* ===== SHARED COMPONENTS - ADMIN & PARTNER PORTALS ===== */
/* Note: Variables are in /css/variables.css, base styles in /css/base.css */

/* ===== BUTTONS ===== */

/* Primary Button - Terra-cotta for main actions (Save, Create, Add) */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--accent);
    color: var(--accent-text);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition);
}

.btn-primary:hover {
    background: var(--accent-hover);
}

/* Secondary Button - White bg, grey border, terra-cotta border on hover */
/* Use for: Cancel, Close, Upload, Edit, navigation buttons */
.btn-secondary,
.btn-white {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--btn-white-bg);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color var(--transition);
}

.btn-secondary:hover,
.btn-white:hover {
    background: var(--btn-white-bg);
    border-color: var(--accent);
}

/* Cancel Button - Alias for secondary */
.cancel-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--btn-white-bg);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color var(--transition);
}

.cancel-btn:hover {
    background: var(--btn-white-bg);
    border-color: var(--accent);
}

/* Back Button - Secondary style with icon support */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--btn-white-bg);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color var(--transition);
}

.back-btn:hover {
    background: var(--btn-white-bg);
    border-color: var(--accent);
}

.back-btn svg {
    stroke: currentColor;
}

/* Danger Button - Red for destructive actions */
.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--error);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition);
}

.btn-danger:hover {
    background: var(--error-hover, #dc2626);
}

/* ===== FORM ELEMENTS ===== */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-label, var(--text-secondary));
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 14px;
    font-size: 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-input, var(--bg-card));
    color: var(--text-primary);
    transition: border-color var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.form-group input[readonly],
.form-group textarea[readonly] {
    background: var(--bg-hover, #f5f5f5);
    color: var(--text-muted);
    cursor: not-allowed;
}

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

/* Form row - horizontal layout */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Form actions - button container */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 16px;
}

/* ===== MODAL COMPONENTS ===== */

/* Modal close button */
.modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: var(--btn-white-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color var(--transition);
}

.modal-close:hover {
    background: var(--btn-white-bg);
    border-color: var(--accent);
}

/* Modal footer buttons */
.modal-footer,
.modal-footer-fixed {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-modal, var(--bg-card));
}

.modal-footer .btn-secondary,
.modal-footer-fixed .btn-secondary {
    padding: 10px 20px;
}

.modal-footer .btn-primary,
.modal-footer-fixed .btn-primary,
.modal-footer .save-btn,
.modal-footer-fixed .save-btn {
    padding: 10px 20px;
}

/* ===== STATUS BADGES ===== */

/* Base badge style */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Active/Success badge */
.status-badge.active,
.status-badge.connected,
.status-badge.status-resolved {
    background: var(--success-bg, rgba(13, 172, 56, 0.1));
    color: var(--success);
    border: 1px solid var(--success);
}

/* Inactive/Pending badge */
.status-badge.inactive,
.status-badge.status-pending {
    background: var(--warning-bg, rgba(245, 158, 11, 0.1));
    color: var(--warning, #f59e0b);
    border: 1px solid var(--warning, #f59e0b);
}

/* Disconnected/Dismissed badge */
.status-badge.disconnected,
.status-badge.status-dismissed {
    background: var(--error-bg, rgba(239, 68, 68, 0.1));
    color: var(--error, #ef4444);
    border: 1px solid var(--error, #ef4444);
}

/* ===== CARDS ===== */

/* Base card style */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

/* Card with hover effect */
.card-hover {
    transition: border-color var(--transition), transform var(--transition);
}

.card-hover:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

/* Detail block - used in detail pages */
.detail-block {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.detail-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.detail-block-header h3 {
    font-size: 1.0rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.detail-block-content {
    padding: 20px;
}

/* Settings card - for settings pages */
.settings-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 24px;
}

.settings-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

/* ===== TOAST NOTIFICATIONS ===== */

.toast {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    min-width: 280px;
    max-width: 400px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateX(120%);
    transition: all 0.3s ease;
}

.toast.show {
    display: block !important;
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* Rainbow top border animation */
.toast::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--rainbow-gradient);
    background-size: 200% 200%;
    animation: rainbowShift 4s ease infinite;
    border-radius: 12px 12px 0 0;
}

/* ===== TABS ===== */

.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.tab {
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ===== BOOST FLAME BADGE ===== */

.boost-flame-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

.boost-flame-badge.small {
    width: 28px;
    height: 28px;
    padding: 4px;
}

.boost-flame-badge.large {
    width: 40px;
    height: 40px;
    padding: 6px;
}

.boost-flame-badge svg {
    width: 100%;
    height: 100%;
    color: var(--text-primary);
}

/* ===== RESPONSIVE ===== */

@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions .btn-primary,
    .form-actions .btn-secondary {
        width: 100%;
    }

    .modal-footer,
    .modal-footer-fixed {
        flex-direction: column-reverse;
        gap: 8px;
    }

    .modal-footer .btn-primary,
    .modal-footer .btn-secondary,
    .modal-footer-fixed .btn-primary,
    .modal-footer-fixed .btn-secondary {
        width: 100%;
    }
}
