/* ============================================
   Sweet Task - Global Styles
   Consistent Typography & Theme System
   ============================================ */

/* ============================================
   CSS VARIABLES - THEME SYSTEM
   ============================================ */
:root {
    /* Primary Brand Colors */
    --primary-purple: #8b5cf6;
    --primary-cyan: #06b6d4;
    
    /* Status Colors */
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-info: #3b82f6;
    
    /* Dark Theme - Default and Only Theme */
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --bg-tertiary: #374151;
    --bg-card: #1f2937;
    
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;
    
    --border-color: #374151;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
    --gradient-secondary: linear-gradient(135deg, #06b6d4 0%, #8b5cf6 100%);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.4);
    
    /* Effects */
    --glow-primary: 0 0 20px rgba(139, 92, 246, 0.4);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* Typography - Consistent Sizes */
    --font-size-h1: 2rem;           /* Page titles */
    --font-size-h2: 1.5rem;         /* Section titles */
    --font-size-h3: 1.25rem;        /* Card titles */
    --font-size-h4: 1.125rem;       /* Subsection titles */
    --font-size-body: 1rem;         /* Body text */
    --font-size-small: 0.875rem;   /* Small text */
    --font-size-tiny: 0.75rem;     /* Tiny text */
    
    /* Icon Sizes */
    --icon-size-xl: 3rem;
    --icon-size-lg: 2rem;
    --icon-size-md: 1.5rem;
    --icon-size-sm: 1rem;
    --icon-size-xs: 0.75rem;
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: var(--font-size-body);
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: background 0.3s ease, color 0.3s ease;
}

/* ============================================
   TYPOGRAPHY - CONSISTENT SYSTEM
   ============================================ */
h1, .h1 {
    font-size: var(--font-size-h1);
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-primary);
}

h2, .h2 {
    font-size: var(--font-size-h2);
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}

h3, .h3 {
    font-size: var(--font-size-h3);
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-primary);
}

h4, .h4 {
    font-size: var(--font-size-h4);
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
}

p {
    font-size: var(--font-size-body);
    line-height: 1.6;
    color: var(--text-secondary);
}

small, .small {
    font-size: var(--font-size-small);
    color: var(--text-secondary);
}

.tiny {
    font-size: var(--font-size-tiny);
    color: var(--text-muted);
}

/* Mobile Typography */
@media (max-width: 768px) {
    :root {
        --font-size-h1: 1.75rem;
        --font-size-h2: 1.375rem;
        --font-size-h3: 1.125rem;
        --font-size-h4: 1rem;
        --font-size-body: 0.9375rem;
        --font-size-small: 0.8125rem;
        --font-size-tiny: 0.6875rem;
        
        --icon-size-xl: 2.5rem;
        --icon-size-lg: 1.75rem;
        --icon-size-md: 1.25rem;
        --icon-size-sm: 0.875rem;
        --icon-size-xs: 0.6875rem;
    }
}

@media (max-width: 480px) {
    :root {
        --font-size-h1: 1.5rem;
        --font-size-h2: 1.25rem;
        --font-size-h3: 1rem;
        --font-size-h4: 0.9375rem;
        --font-size-body: 0.875rem;
        --font-size-small: 0.75rem;
        --font-size-tiny: 0.625rem;
        
        --icon-size-xl: 2rem;
        --icon-size-lg: 1.5rem;
        --icon-size-md: 1rem;
        --icon-size-sm: 0.75rem;
        --icon-size-xs: 0.625rem;
    }
}

/* ============================================
   LAYOUT UTILITIES
   ============================================ */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }
}

.main-content {
    min-height: calc(100vh - 80px);
    padding: 2rem 0;
}

@media (max-width: 768px) {
    .main-content {
        padding: 1.5rem 0;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 1rem 0;
    }
}

/* ============================================
   BUTTON SYSTEM - CONSISTENT STYLES
   ============================================ */
.btn {
    padding: 0.75rem 1.5rem;
    font-size: var(--font-size-body);
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s var(--ease-smooth);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.3);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-purple);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.3);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: var(--font-size-small);
}

.btn i {
    font-size: var(--icon-size-sm);
}

/* Mobile Buttons */
@media (max-width: 768px) {
    .btn {
        padding: 0.625rem 1.25rem;
    }
    
    .btn-sm {
        padding: 0.5rem 0.875rem;
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 0.625rem 1rem;
        font-size: var(--font-size-small);
    }
    
    .btn-sm {
        padding: 0.5rem 0.75rem;
    }
}

/* ============================================
   CARD SYSTEM - CONSISTENT STYLES
   ============================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s var(--ease-smooth);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: var(--font-size-h3);
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.card-title i {
    font-size: var(--icon-size-md);
    color: var(--primary-purple);
}

.card-body {
    color: var(--text-secondary);
}

/* Mobile Cards */
@media (max-width: 768px) {
    .card {
        padding: 1.25rem;
        border-radius: 14px;
    }
    
    .card-header {
        margin-bottom: 1.25rem;
    }
}

@media (max-width: 480px) {
    .card {
        padding: 1rem;
        border-radius: 12px;
    }
    
    .card-header {
        margin-bottom: 1rem;
    }
}

/* ============================================
   FORM SYSTEM - CONSISTENT STYLES
   ============================================ */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: var(--font-size-small);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: var(--font-size-body);
    font-weight: 500;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-purple);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    cursor: pointer;
}

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

.form-help {
    display: block;
    font-size: var(--font-size-tiny);
    color: var(--text-muted);
    margin-top: 0.375rem;
}

/* Mobile Forms */
@media (max-width: 480px) {
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-control {
        padding: 0.625rem 0.875rem;
    }
}

/* ============================================
   MODAL SYSTEM - CONSISTENT STYLES
   ============================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s var(--ease-bounce);
    box-shadow: var(--shadow-xl);
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
}

.modal-header h3 {
    font-size: var(--font-size-h3);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-header h3 i {
    font-size: var(--icon-size-md);
    color: var(--primary-purple);
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--bg-card);
    color: var(--text-primary);
    transform: scale(1.1);
}

.modal-body {
    padding: 1.5rem;
    max-height: calc(90vh - 140px);
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.75rem;
    background: var(--bg-secondary);
}

/* Mobile Modals */
@media (max-width: 768px) {
    .modal-content {
        max-width: 420px;
        width: 95%;
    }
    
    .modal-header {
        padding: 1rem 1.25rem;
    }
    
    .modal-header h3 {
        font-size: var(--font-size-h4);
    }
    
    .modal-body {
        padding: 1.25rem;
    }
    
    .modal-footer {
        padding: 0.875rem 1.25rem;
        gap: 0.625rem;
    }
}

@media (max-width: 480px) {
    .modal-content {
        max-width: 360px;
    }
    
    .modal-header {
        padding: 0.875rem 1rem;
    }
    
    .modal-close {
        width: 28px;
        height: 28px;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 0.75rem 1rem;
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
}

/* ============================================
   ICON SYSTEM - CONSISTENT SIZES
   ============================================ */
.icon-xl {
    font-size: var(--icon-size-xl);
}

.icon-lg {
    font-size: var(--icon-size-lg);
}

.icon-md {
    font-size: var(--icon-size-md);
}

.icon-sm {
    font-size: var(--icon-size-sm);
}

.icon-xs {
    font-size: var(--icon-size-xs);
}

/* ============================================
   NOTIFICATION SYSTEM
   ============================================ */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    min-width: 300px;
    max-width: 400px;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideInRight 0.3s var(--ease-smooth);
}

.notification.success {
    border-left: 4px solid var(--color-success);
}

.notification.error {
    border-left: 4px solid var(--color-danger);
}

.notification.warning {
    border-left: 4px solid var(--color-warning);
}

.notification.info {
    border-left: 4px solid var(--color-info);
}

.notification i {
    font-size: var(--icon-size-md);
}

.notification.success i {
    color: var(--color-success);
}

.notification.error i {
    color: var(--color-danger);
}

.notification.warning i {
    color: var(--color-warning);
}

.notification.info i {
    color: var(--color-info);
}

.notification-message {
    flex: 1;
    font-size: var(--font-size-small);
    color: var(--text-primary);
}

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

@media (max-width: 480px) {
    .notification {
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: none;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center {
    text-align: center;
}

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

.text-left {
    text-align: left;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.d-flex {
    display: flex;
}

.align-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* ============================================
   STATUS BADGES - CONSISTENT STYLES
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: var(--font-size-tiny);
    font-weight: 600;
    border-radius: 20px;
}

.badge i {
    font-size: var(--icon-size-xs);
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--color-warning);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-danger);
}

.badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--color-info);
}

.badge-primary {
    background: rgba(139, 92, 246, 0.1);
    color: var(--primary-purple);
}

/* ============================================
   LOADING STATES
   ============================================ */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--primary-purple);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ============================================
   SCROLLBAR STYLING - HIDDEN
   ============================================ */
/* Hide scrollbar for Chrome, Safari and Opera */
::-webkit-scrollbar {
    width: 0px;
    height: 0px;
    display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
* {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Styles */
*:focus-visible {
    outline: 2px solid var(--primary-purple);
    outline-offset: 2px;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .header,
    .footer,
    .btn,
    .modal {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .card {
        border: 1px solid #ccc;
        box-shadow: none;
        break-inside: avoid;
    }
}
