/**
 * Unlimitr Live - CSS Styles
 * 
 * Common styles for the Unlimitr Live portal.
 * This file contains shared styles used across all views.
 */

/* ===================================
   CSS Variables
   =================================== */
:root {
    --ul-primary: #0D3256;
    --ul-primary-light: #1a4a7a;
    --ul-primary-dark: #0a2845;
    --ul-secondary: #10b981;
    --ul-secondary-light: #34d399;
    --ul-secondary-dark: #059669;
    --ul-accent: #f59e0b;
    --ul-accent-light: #fbbf24;
    --ul-dark: #0D3256;
    --ul-light: #f8fafc;
    --ul-gray-50: #f8fafc;
    --ul-gray-100: #f1f5f9;
    --ul-gray-200: #e2e8f0;
    --ul-gray-300: #cbd5e1;
    --ul-gray-400: #94a3b8;
    --ul-gray-500: #64748b;
    --ul-gray-600: #475569;
    --ul-gray-700: #334155;
    --ul-gray-800: #1e293b;
    --ul-gradient: linear-gradient(135deg, #0D3256 0%, #0a2845 50%, #082238 100%);
    --ul-gradient-secondary: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --ul-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --ul-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --ul-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --ul-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --ul-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --ul-radius-sm: 8px;
    --ul-radius: 12px;
    --ul-radius-lg: 16px;
    --ul-radius-xl: 24px;
    --ul-transition: 0.2s ease;
}

/* ===================================
   Base Styles
   =================================== */
.ul-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.ul-section {
    padding: 3rem 0;
}

/* ===================================
   Typography
   =================================== */
.ul-heading-xl {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--ul-dark);
    line-height: 1.2;
}

.ul-heading-lg {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--ul-dark);
}

.ul-heading-md {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--ul-dark);
}

.ul-text-muted {
    color: var(--ul-gray-500);
}

.ul-text-primary {
    color: var(--ul-primary);
}

.ul-text-success {
    color: var(--ul-secondary);
}

/* ===================================
   Buttons
   =================================== */
.ul-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--ul-radius);
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all var(--ul-transition);
}

.ul-btn-primary {
    background: var(--ul-gradient);
    color: white;
}

.ul-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
    color: white;
}

.ul-btn-secondary {
    background: var(--ul-gray-100);
    color: var(--ul-dark);
}

.ul-btn-secondary:hover {
    background: var(--ul-gray-200);
    color: var(--ul-dark);
}

.ul-btn-success {
    background: var(--ul-gradient-secondary);
    color: white;
}

.ul-btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
    color: white;
}

.ul-btn-outline {
    background: transparent;
    border: 2px solid var(--ul-primary);
    color: var(--ul-primary);
}

.ul-btn-outline:hover {
    background: var(--ul-primary);
    color: white;
}

.ul-btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.ul-btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.ul-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ===================================
   Cards
   =================================== */
.ul-card {
    background: white;
    border-radius: var(--ul-radius-lg);
    box-shadow: var(--ul-shadow);
    overflow: hidden;
    transition: all 0.3s ease;
}

.ul-card:hover {
    box-shadow: var(--ul-shadow-lg);
}

.ul-card-body {
    padding: 1.5rem;
}

/* ===================================
   Badges
   =================================== */
.ul-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.ul-badge-primary {
    background: rgba(99, 102, 241, 0.1);
    color: var(--ul-primary);
}

.ul-badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--ul-secondary);
}

.ul-badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--ul-accent);
}

.ul-badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.ul-badge-live {
    background: #ef4444;
    color: white;
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* ===================================
   Forms
   =================================== */
.ul-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--ul-gray-200);
    border-radius: var(--ul-radius);
    font-size: 0.9375rem;
    transition: all var(--ul-transition);
}

.ul-input:focus {
    outline: none;
    border-color: var(--ul-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.ul-input::placeholder {
    color: var(--ul-gray-400);
}

.ul-select {
    appearance: none;
    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.75rem center;
    background-repeat: no-repeat;
    background-size: 1.25rem;
    padding-right: 2.5rem;
}

/* ===================================
   Alerts
   =================================== */
.ul-alert {
    padding: 1rem 1.25rem;
    border-radius: var(--ul-radius);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.ul-alert-info {
    background: rgba(99, 102, 241, 0.1);
    color: var(--ul-primary-dark);
}

.ul-alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--ul-secondary-dark);
}

.ul-alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #b45309;
}

.ul-alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

/* ===================================
   Loading States
   =================================== */
.ul-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--ul-gray-200);
    border-top-color: var(--ul-primary);
    border-radius: 50%;
    animation: ul-spin 0.8s linear infinite;
}

@keyframes ul-spin {
    to {
        transform: rotate(360deg);
    }
}

.ul-skeleton {
    background: linear-gradient(90deg, var(--ul-gray-100) 25%, var(--ul-gray-200) 50%, var(--ul-gray-100) 75%);
    background-size: 200% 100%;
    animation: ul-skeleton 1.5s ease-in-out infinite;
    border-radius: var(--ul-radius-sm);
}

@keyframes ul-skeleton {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ===================================
   Animations
   =================================== */
.ul-fade-in {
    animation: ul-fade-in 0.3s ease-out;
}

@keyframes ul-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.ul-slide-up {
    animation: ul-slide-up 0.4s ease-out;
}

@keyframes ul-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ul-scale-in {
    animation: ul-scale-in 0.3s ease-out;
}

@keyframes ul-scale-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===================================
   Utilities
   =================================== */
.ul-text-center {
    text-align: center;
}

.ul-text-right {
    text-align: right;
}

.ul-flex {
    display: flex;
}

.ul-flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ul-flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ul-gap-1 {
    gap: 0.25rem;
}

.ul-gap-2 {
    gap: 0.5rem;
}

.ul-gap-3 {
    gap: 0.75rem;
}

.ul-gap-4 {
    gap: 1rem;
}

.ul-mb-0 {
    margin-bottom: 0;
}

.ul-mb-1 {
    margin-bottom: 0.25rem;
}

.ul-mb-2 {
    margin-bottom: 0.5rem;
}

.ul-mb-3 {
    margin-bottom: 0.75rem;
}

.ul-mb-4 {
    margin-bottom: 1rem;
}

/* ===================================
   Responsive Utilities
   =================================== */
@media (max-width: 991px) {
    .ul-heading-xl {
        font-size: 2rem;
    }
    
    .ul-heading-lg {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .ul-heading-xl {
        font-size: 1.75rem;
    }
    
    .ul-heading-lg {
        font-size: 1.25rem;
    }
    
    .ul-btn {
        padding: 0.625rem 1.25rem;
    }
}

/* ===================================
   Dark Mode Support (optional)
   =================================== */
@media (prefers-color-scheme: dark) {
    .ul-dark-mode {
        --ul-light: #0f172a;
        --ul-gray-50: #1e293b;
        --ul-gray-100: #334155;
        --ul-gray-200: #475569;
    }
}

/* ===================================
   Button loading state (AJAX)
   =================================== */
.ul-btn-loading {
    pointer-events: none;
    opacity: 0.85;
    cursor: not-allowed !important;
}
button.ul-btn-loading {
    cursor: not-allowed !important;
}
.ul-btn-loading .ul-btn-spinner {
    display: inline-block;
    width: 1em;
    height: 1em;
    margin-right: 0.35em;
    vertical-align: -0.15em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: ul-spin 0.6s linear infinite;
}
@keyframes ul-spin {
    to { transform: rotate(360deg); }
}

/* ===================================
   Print Styles
   =================================== */
@media print {
    .ul-btn,
    .ul-no-print {
        display: none !important;
    }
    
    .ul-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
