/* ========== FORM ELEMENTS ========== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input {
    width: 100%;
    padding: 13px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.input-group input {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
}

.input-group input::placeholder {
    color: var(--text-muted);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* ========== BUTTONS ========== */
.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-on-primary);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-gold);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(217, 170, 30, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-logout {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.btn-logout:hover {
    border-color: var(--error);
    color: var(--error);
    background: rgba(255, 82, 82, 0.05);
}

.btn-create-group {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-on-primary);
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
    box-shadow: var(--shadow-gold);
    white-space: nowrap;
}

.btn-create-group:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(217, 170, 30, 0.3);
}

.btn-secondary {
    padding: 10px 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-subtle);
}

/* ========== GROUP CARDS ========== */
.group-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.group-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.group-card.active {
    border-color: var(--primary);
    background: var(--primary-subtle);
    box-shadow: 0 0 0 1px var(--primary), var(--shadow-md);
}

.group-card h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
}

.group-card p {
    font-size: 12px;
    color: var(--text-muted);
}

.group-card .member-count {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ========== USER CARDS ========== */
.user-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.user-card:hover {
    border-color: var(--primary);
    transform: translateX(3px);
    box-shadow: var(--shadow-md);
}

.user-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    color: var(--text-on-primary);
    flex-shrink: 0;
}

.user-info {
    min-width: 0;
}

.user-info h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-info p {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.location-status {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
    font-size: 11px;
    color: var(--text-muted);
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-muted);
    flex-shrink: 0;
}

.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 8px rgba(0, 200, 83, 0.4);
}

.status-dot.recent {
    background: var(--info);
    box-shadow: 0 0 8px rgba(33, 150, 243, 0.4);
}

.status-dot.away {
    background: var(--warning);
    box-shadow: 0 0 8px rgba(255, 179, 0, 0.4);
}

/* ========== ERROR MESSAGE ========== */
.error-message {
    background: rgba(255, 82, 82, 0.08);
    border: 1px solid rgba(255, 82, 82, 0.3);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 20px;
    color: var(--error);
    font-size: 14px;
    display: none;
}

/* ========== MODAL ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 520px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    color: var(--text-muted);
    font-size: 20px;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    border-color: var(--error);
    color: var(--error);
    background: rgba(255, 82, 82, 0.05);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

/* ========== WIZARD STEPS ========== */
.steps {
    display: flex;
    margin-bottom: 24px;
    gap: 2px;
}

.step {
    flex: 1;
    text-align: center;
    padding: 10px 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 3px solid var(--border-light);
    transition: var(--transition);
}

.step.active {
    color: var(--primary);
    border-color: var(--primary);
    font-weight: 600;
}

.step.completed {
    color: var(--success);
    border-color: var(--success);
}

.step-content {
    display: none;
}

.step-content.active {
    display: block;
}

/* ========== CHECKBOX LIST ========== */
.checkbox-list {
    max-height: 250px;
    overflow-y: auto;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.checkbox-item:hover {
    border-color: var(--primary);
    background: var(--primary-subtle);
}

.checkbox-item.selected {
    border-color: var(--success);
    background: rgba(0, 200, 83, 0.06);
}

.checkbox-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.checkbox-item input {
    display: none;
}

.checkbox-item .checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
}

.checkbox-item.selected .checkmark {
    border-color: var(--success);
    background: var(--success);
}

.checkbox-item.selected .checkmark::after {
    content: '';
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

/* ========== RADIO LIST ========== */
.radio-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.radio-item:hover {
    border-color: var(--primary);
}

.radio-item.selected {
    border-color: var(--primary);
    background: var(--primary-subtle);
}

.radio-item .radio-circle {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
}

.radio-item.selected .radio-circle {
    border-color: var(--primary);
}

.radio-item.selected .radio-circle::after {
    content: '';
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
}

/* ========== TOAST NOTIFICATION ========== */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 14px 24px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    z-index: 99999;
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    border-color: var(--success);
    color: #1B5E20;
    background: linear-gradient(135deg, #E8F5E9, var(--bg-card));
}

.toast.error {
    border-color: var(--error);
    color: #B71C1C;
    background: linear-gradient(135deg, #FFEBEE, var(--bg-card));
}

.toast.warning {
    border-color: var(--warning);
    color: #E65100;
    background: linear-gradient(135deg, #FFF3E0, var(--bg-card));
}

/* ========== LOADING OVERLAY ========== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(253, 247, 231, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.loading-overlay.hidden {
    display: none;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========== COLOR PICKER ========== */
.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

input[type="color"] {
    -webkit-appearance: none;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    background: none;
    cursor: pointer;
    padding: 0;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: 2px solid var(--border);
    border-radius: 50%;
}

/* ========== GROUP COLOR DOT ========== */
.group-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
    flex-shrink: 0;
}

/* ========== SELECT ELEMENTS (used in modals) ========== */
select {
    font-family: inherit;
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}
