/*
 * SIP Panel v4 - Main Stylesheet
 * Modular CSS Architecture
 */

/* ========== CSS IMPORTS ========== */
@import url('modules/base.css');
@import url('modules/navbar.css');
@import url('modules/layout.css');
@import url('modules/toolbar.css');
@import url('modules/buttons.css');
@import url('modules/cards.css');
@import url('modules/badges.css');
@import url('modules/tables.css');
@import url('modules/modal.css');
@import url('modules/forms.css');
@import url('modules/components.css');
@import url('modules/responsive.css');


/* ========== SMART BUTTON (Animated Gradient) ========== */
.btn-smart {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 12px;
    color: white;
    cursor: pointer;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #f5576c 75%, #667eea 100%);
    background-size: 300% 300%;
    animation: gradientShift 3s ease infinite;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.btn-smart svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.btn-smart:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.5);
}

.btn-smart:active {
    transform: translateY(0);
}

.btn-smart.active {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 50%, #22c55e 100%);
    background-size: 200% 200%;
    box-shadow: 0 2px 10px rgba(34, 197, 94, 0.4);
}

/* Mini Smart button for cards */
.btn-smart-mini {
    padding: 3px 10px;
    font-size: 11px;
    border-radius: 6px;
}

.btn-smart-mini svg {
    display: none;
}

/* Group action button */
.btn-action-group {
    background: rgba(99, 102, 241, 0.2) !important;
    color: #818cf8 !important;
}

.btn-action-group:hover {
    background: rgba(99, 102, 241, 0.3) !important;
}

.btn-smart::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmer 2s infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}


/* ========== GROUP SYSTEM ========== */
.group-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 16px;
}

.group-select {
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 13px;
    min-width: 150px;
    cursor: pointer;
}

.group-select:focus {
    border-color: var(--blue);
    outline: none;
}

.group-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.group-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.group-manager-btn {
    padding: 6px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.group-manager-btn:hover {
    background: var(--bg-hover);
    color: var(--text);
}

/* Group colors */
.group-color-1 { background: rgba(99, 102, 241, 0.2); color: #818cf8; }
.group-color-2 { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.group-color-3 { background: rgba(249, 115, 22, 0.2); color: #fb923c; }
.group-color-4 { background: rgba(236, 72, 153, 0.2); color: #f472b6; }
.group-color-5 { background: rgba(14, 165, 233, 0.2); color: #38bdf8; }
.group-color-6 { background: rgba(168, 85, 247, 0.2); color: #c084fc; }


/* ========== TOAST FIX (Push notifications style) ========== */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    max-width: 320px;
    padding: 12px 16px;
    border-radius: 10px;
    font-weight: 500;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    backdrop-filter: blur(10px);
    transform: translateX(100px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-success {
    background: rgba(34, 197, 94, 0.95);
    color: white;
}

.toast-error {
    background: rgba(239, 68, 68, 0.95);
    color: white;
}

.toast-info {
    background: rgba(59, 130, 246, 0.95);
    color: white;
}

.toast-warning {
    background: rgba(249, 115, 22, 0.95);
    color: white;
}

.toast svg,
.toast-icon svg {
    width: 18px !important;
    height: 18px !important;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
}

#flash-messages {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    max-width: 320px;
}

#flash-messages .toast {
    position: relative;
    top: auto;
    right: auto;
    margin-bottom: 10px;
    transform: none;
    opacity: 1;
    animation: toastSlideIn 0.3s ease;
}

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

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

.toast.hiding {
    animation: toastSlideOut 0.3s ease forwards;
}


/* ========== GROUP MODAL ========== */
.group-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.group-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.group-item-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.group-item-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.group-item-name {
    font-weight: 500;
}

.group-item-count {
    color: var(--text-muted);
    font-size: 12px;
}

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

.color-picker-row {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.color-option {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s, border-color 0.2s;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.selected {
    border-color: white;
    box-shadow: 0 0 0 2px var(--blue);
}


/* ========== HEADER ACTIONS LAYOUT ========== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
