/**
 * My Dream Flooring - Mobile Portal CSS
 * Modern, Mobile-First Design System
 */

/* ============================================
   CSS CUSTOM PROPERTIES
   ============================================ */
:root {
    /* Brand Colors */
    --primary-color: #10888c;
    --primary-dark: #013D3F;
    --secondary-color: #013D3F;
    --background-color: #96F5FF;
    --success-color: #2ecc71;
    --success-dark: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #3498db;
    
    /* Neutral Colors */
    --dark: #013D3F;
    --gray-900: #212529;
    --gray-800: #343a40;
    --gray-700: #495057;
    --gray-600: #6c757d;
    --gray-500: #adb5bd;
    --gray-400: #ced4da;
    --gray-300: #dee2e6;
    --gray-200: #e9ecef;
    --gray-100: #f8f9fa;
    --white: #ffffff;
    
    /* Background Colors */
    --bg-primary: #013D3F;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 15px;
    --radius-xl: 20px;
    --radius-pill: 50px;
    --radius-circle: 50%;
    
    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 8px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* Touch Targets */
    --touch-target-min: 44px;
    
    /* Z-index Scale */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
}

/* ============================================
   GLOBAL STYLES
   ============================================ */
* {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    -webkit-touch-callout: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--dark);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-bottom: 70px;
}

body.portal-body {
    background: linear-gradient(135deg, var(--background-color) 0%, var(--background-color) 100%);
    min-height: 100vh;
}

html {
    scroll-behavior: smooth;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }

/* ============================================
   CONTAINERS & LAYOUT
   ============================================ */
.portal-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}

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

.content-wrapper {
    padding: var(--spacing-md);
    padding-bottom: 80px;
}

/* ============================================
   AUTHENTICATION SCREENS
   ============================================ */
.auth-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--white);
    padding: var(--spacing-xl) var(--spacing-lg);
}

.auth-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.logo-section {
    text-align: center;
    margin-bottom: 1rem;
}

.logo-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--radius-xl);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-md);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.logo-icon i {
    font-size: 2.5rem;
    color: var(--white);
}


/* ============================================
   FORM ELEMENTS
   ============================================ */
.modern-input {
    background: var(--gray-100);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1rem 1.5rem;
    font-size: 16px;
    transition: all var(--transition-base);
    width: 100%;
    min-height: var(--touch-target-min);
}

.modern-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.modern-input::placeholder {
    color: var(--gray-500);
}

.code-input-group {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin: 2rem 0;
}

.code-digit {
    width: 50px;
    height: 60px;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: var(--gray-100);
    transition: all var(--transition-base);
}

.code-digit:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

/* ============================================
   BUTTONS
   ============================================ */
.modern-button {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    border: none;
    border-radius: var(--radius-lg);
    padding: 1rem 1.5rem;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
    transition: all var(--transition-base);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    cursor: pointer;
    min-height: var(--touch-target-min);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.modern-button:hover,
.modern-button:focus {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    outline: none;
}

.modern-button:active {
    transform: translateY(0);
}

.modern-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-gradient-success {
    background: linear-gradient(135deg, var(--success-color), var(--success-dark));
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
}

.btn-gradient-warning {
    background: linear-gradient(135deg, #ffeaa7, #fdcb6e);
    color: var(--dark);
    box-shadow: 0 4px 15px rgba(253, 203, 110, 0.3);
}

.btn-gradient-info {
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    box-shadow: 0 4px 15px rgba(116, 185, 255, 0.3);
}

/* ============================================
   CARDS
   ============================================ */
.dashboard-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    margin-bottom: var(--spacing-md);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    border: 1px solid var(--gray-200);
}

.dashboard-card:active {
    transform: scale(0.98);
}

.dashboard-card.clickable {
    cursor: pointer;
}

.dashboard-card.clickable:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.agreement-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    color: var(--white);
    margin-bottom: var(--spacing-md);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.agreement-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.referral-card {
    background: linear-gradient(135deg, #66d164 0%, #358733 100%);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    text-align: center;
    margin-bottom: var(--spacing-md);
    box-shadow: var(--shadow-lg);
}

.referral-code {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--dark);
    margin: 1rem 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    background: var(--white);
    padding: 1rem;
    border-radius: var(--radius-md);
}

/* ============================================
   HEADER
   ============================================ */

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.code-digit.shake {
    animation: shake 0.5s;
    border-color: #e74c3c;
}



.portal-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* This makes the video cover the entire container */
  z-index: -1; /* This puts the video behind other content */
}

.portal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    padding: 1.5rem var(--spacing-md);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    box-shadow: var(--shadow-md);
}

.page-header {
    background: var(--white);
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
}

.page-header .btn-back {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--dark);
    transition: all var(--transition-base);
}

.page-header .btn-back:hover {
    background: var(--gray-100);
}

/* ============================================
   BOTTOM NAVIGATION
   ============================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    padding: 0.75rem 0 0.5rem;
    display: flex;
    justify-content: space-around;
    z-index: var(--z-fixed);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.nav-item {
    flex: 1;
    text-align: center;
    color: var(--gray-600);
    text-decoration: none;
    transition: all var(--transition-fast);
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: var(--touch-target-min);
}

.nav-item:hover,
.nav-item:focus {
    text-decoration: none;
    color: var(--primary-color);
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-icon {
    font-size: 24px;
    margin-bottom: 0.25rem;
    transition: transform var(--transition-base);
}

.nav-item.active .nav-icon {
    transform: scale(1.1);
}

.nav-label {
    font-size: 11px;
    font-weight: 500;
}

/* ============================================
   PROGRESS BARS
   ============================================ */
.modern-progress {
    height: 8px;
    border-radius: 10px;
    background: var(--gray-200);
    overflow: hidden;
    position: relative;
}

.modern-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--success-color), var(--success-dark));
    border-radius: 10px;
    transition: width var(--transition-base);
}

/* ============================================
   QUICK STATS
   ============================================ */
.quick-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    margin-bottom: 0.75rem;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

/* ============================================
   MODALS & SHEETS
   ============================================ */
.payment-sheet {
    background: var(--white);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 1.5rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

.sheet-handle {
    width: 40px;
    height: 4px;
    background: var(--gray-300);
    border-radius: 2px;
    margin: 0 auto 1rem;
}

/* ============================================
   TOUCH FEEDBACK
   ============================================ */
.touch-feedback {
    position: relative;
    overflow: hidden;
}

.touch-feedback::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.touch-feedback:active::after {
    width: 300px;
    height: 300px;
}

/* ============================================
   ANIMATIONS
   ============================================ */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* ============================================
   SKELETON LOADING
   ============================================ */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--gray-200) 25%,
        var(--gray-300) 50%,
        var(--gray-200) 75%
    );
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ============================================
   FLOATING ACTION BUTTON
   ============================================ */
.fab-button {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--success-color), var(--success-dark));
    color: var(--white);
    border: none;
    font-size: 24px;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-sticky);
    transition: all var(--transition-base);
    cursor: pointer;
}

.fab-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.5);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
}

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

.rounded-xl {
    border-radius: var(--radius-xl);
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */
@media (max-width: 767px) {
    .portal-container {
        padding: 0;
    }
    
    .content-wrapper {
        padding: var(--spacing-sm);
    }
}

/* Quick Actions Grid Fix */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Fix for dashboard cards in grid */
.dashboard-card.clickable {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    text-align: center;
    padding: 1.5rem 1rem;
}

/* Ensure cards don't get cut off */
.row {
    margin-left: 0;
    margin-right: 0;
}

.row > [class*='col-'] {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

/* Fix for colored cards */
.dashboard-card.card-colored,
.dashboard-card[style*="background: linear-gradient"] {
    color: var(--white) !important;
}

.dashboard-card.card-colored *,
.dashboard-card[style*="background: linear-gradient"] * {
    color: var(--white) !important;
}

.dashboard-card.card-colored:hover,
.dashboard-card[style*="background: linear-gradient"]:hover {
    color: var(--white) !important;
}

.notification-bell-container {
    position: relative;
    display: inline-block;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e74c3c;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.4);
    animation: badge-appear 0.3s ease;
}

@keyframes badge-appear {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Jiggle Animation for Unread Notifications */
@keyframes jiggle {
    0%, 100% { transform: rotate(0deg); }
    10%, 30%, 50%, 70%, 90% { transform: rotate(-10deg); }
    20%, 40%, 60%, 80% { transform: rotate(10deg); }
}

.notification-bell-jiggle {
    animation: jiggle 0.5s ease-in-out infinite;
    transform-origin: top center;
}

/* Stop jiggling on hover */
.notification-bell-container:hover .notification-bell-jiggle {
    animation: none;
}

.notification-icon {
    font-size: 1.25rem;
    color: #2d3436;
    cursor: pointer;
    transition: all 0.2s ease;
}

.notification-icon:hover {
    color: #667eea;
    transform: scale(1.1);
}

/* Pulse effect when new notification arrives */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(231, 76, 60, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0);
    }
}

.notification-badge.pulse {
    animation: pulse 2s infinite;
}