/* User Dashboard CSS - Mobile First Design */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Animation */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
                radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.2) 0%, transparent 50%);
    z-index: -1;
    animation: backgroundShift 20s ease-in-out infinite;
}

@keyframes backgroundShift {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Mobile Layout Container */
.mobile-app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 100vw;
    position: relative;
}

/* Top Header */
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(15, 15, 35, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 1000;
}

.points-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #000;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

.coin-icon {
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, #ffd700, #ffb300);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #000;
}

.user-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.notification-btn, .profile-btn {
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.notification-btn:hover, .profile-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: #ff4757;
    border-radius: 50%;
    border: 2px solid #0f0f23;
}

.username {
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    margin-right: 8px;
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-top: 60px;
    margin-bottom: 80px;
    padding: 20px;
    overflow-y: auto;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: rgba(15, 15, 35, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px;
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.6);
    min-width: 60px;
}

.nav-item.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.nav-item:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.nav-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.nav-label {
    font-size: 10px;
    font-weight: 500;
    text-align: center;
}

/* Offer Networks Grid */
.offers-section {
    margin-bottom: 30px;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.networks-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.network-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-height: 120px;
    position: relative;
    overflow: hidden;
}

.network-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.network-card:hover::before {
    opacity: 1;
}

.network-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.network-image {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #667eea;
}

.network-name {
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
    text-align: center;
    line-height: 1.2;
}

.network-description {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Gift Cards Section */
.gift-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 30px;
}

.gift-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.gift-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 119, 198, 0.1), rgba(120, 219, 255, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gift-card:hover::before {
    opacity: 1;
}

.gift-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.gift-card-image {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    object-fit: cover;
    margin: 0 auto 12px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #ff77c6;
}

.gift-card-name {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
}

.gift-card-value {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 4px;
}

.gift-card-points {
    font-size: 12px;
    color: #ffd700;
    font-weight: 600;
}

/* Points History Section */
.points-history {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.history-item:last-child {
    border-bottom: none;
}

.history-description {
    font-size: 14px;
    color: #ffffff;
}

.history-points {
    font-size: 14px;
    font-weight: 600;
    color: #4ade80;
}

.history-points.negative {
    color: #f87171;
}

.history-date {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

/* Referral Section */
.referral-section {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
}

.referral-message {
    font-size: 16px;
    color: #ffffff;
    margin-bottom: 20px;
    line-height: 1.5;
}

.referral-code-container {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.referral-code {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 14px;
    color: #ffffff;
    word-break: break-all;
    line-height: 1.4;
}

.copy-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.referral-illustration {
    margin-top: 20px;
    font-size: 48px;
    opacity: 0.6;
}

/* Notifications Popup */
.notifications-popup {
    position: fixed;
    top: 70px;
    right: 20px;
    width: 300px;
    max-height: 400px;
    background: rgba(15, 15, 35, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    z-index: 1001;
    overflow-y: auto;
    display: none;
}

.notifications-popup.show {
    display: block;
    animation: slideInRight 0.3s ease;
}

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

.notification-item {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-title {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 4px;
}

.notification-message {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
}

.notification-date {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 4px;
}

/* Profile Dropdown */
.profile-dropdown {
    position: fixed;
    top: 70px;
    right: 20px;
    width: 200px;
    background: rgba(15, 15, 35, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 8px;
    z-index: 1001;
    display: none;
}

.profile-dropdown.show {
    display: block;
    animation: slideInRight 0.3s ease;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    color: #ffffff;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* Iframe Container for Offer Walls */
.offer-iframe-container {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 80px;
    background: #ffffff;
    z-index: 999;
    display: none;
}

.offer-iframe-container.show {
    display: block;
}

.offer-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.close-iframe-btn {
    position: absolute;
    top: -20px;
    left: 50%; /* السطر الجديد */
    transform: translateX(-50%); /* السطر الجديد */
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    color: #ffffff;
    font-size: 18px;
    cursor: pointer;
    z-index: 1000;
}


/* Gift Card Requests History */
.gift-requests-history {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    margin-top: 20px;
}

.request-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.request-item:last-child {
    border-bottom: none;
}

.request-info {
    flex: 1;
}

.request-name {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 4px;
}

.request-details {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.request-status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pending {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.status-approved {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
}

.status-rejected {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

.status-cancelled {
    background: rgba(108, 117, 125, 0.2);
    color: #6c757d;
}

/* Responsive Design for Tablets */
@media (min-width: 768px) {
    .mobile-app-container {
        max-width: 768px;
        margin: 0 auto;
    }
    
    .networks-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
    }
    
    .gift-cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .notifications-popup {
        width: 350px;
    }
}

/* Responsive Design for Desktop */
@media (min-width: 1024px) {
    .mobile-app-container {
        max-width: 1024px;
        flex-direction: row;
    }
    
    .top-header {
        position: relative;
        height: 80px;
        flex-shrink: 0;
    }
    
    .bottom-nav {
        position: relative;
        height: auto;
        width: 200px;
        flex-direction: column;
        padding: 20px;
        background: rgba(15, 15, 35, 0.95);
        border-top: none;
        border-right: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .nav-item {
        width: 100%;
        flex-direction: row;
        justify-content: flex-start;
        gap: 12px;
        padding: 12px 16px;
        margin-bottom: 8px;
    }
    
    .nav-label {
        font-size: 14px;
    }
    
    .main-content {
        flex: 1;
        margin: 0;
        padding: 40px;
    }
    
    .networks-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .gift-cards-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Success/Error Messages */
.message-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(15, 15, 35, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    z-index: 1002;
    min-width: 300px;
    display: none;
}

.message-popup.show {
    display: block;
    animation: popIn 0.3s ease;
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.message-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.message-icon.success {
    color: #4ade80;
}

.message-icon.error {
    color: #f87171;
}

.message-title {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
}

.message-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
    margin-bottom: 20px;
}

.message-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.message-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* Email Verification Alert */
.email-verification-alert {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.alert-title {
    font-size: 16px;
    font-weight: 600;
    color: #ffc107;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
    margin-bottom: 16px;
}

.alert-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.alert-btn {
    background: rgba(255, 193, 7, 0.2);
    border: 1px solid rgba(255, 193, 7, 0.5);
    border-radius: 8px;
    padding: 8px 16px;
    color: #ffc107;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.alert-btn:hover {
    background: rgba(255, 193, 7, 0.3);
    color: #ffc107;
}

.alert-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: #ffffff;
}

.alert-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    color: #ffffff;
}


/* Gift Card Branches Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1003;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: rgba(15, 15, 35, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    min-width: 300px;
}

.close-button {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 24px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-button:hover {
    color: #ffffff;
}

#modal-card-name {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 20px;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#modal-branches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* Responsive adjustments for modal */
@media (max-width: 768px) {
    .modal-content {
        margin: 20px;
        max-width: calc(100vw - 40px);
    }
    
    #modal-branches-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) {
    #modal-branches-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    #modal-branches-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}


/* User Input Section Styles */
.user-input-section {
    margin: 20px 0;
    padding: 0 20px;
}

.input-section-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.input-section-card .section-title {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 20px;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: #ffffff;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-control:read-only {
    background: rgba(255, 255, 255, 0.05);
    cursor: not-allowed;
}

.error-message {
    color: #ff6b6b;
    font-size: 14px;
    margin-top: 8px;
    font-weight: 500;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    margin-top: 12px;
    padding: 8px 16px;
    font-size: 14px;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Responsive adjustments for user input section */
@media (max-width: 768px) {
    .user-input-section {
        padding: 0 16px;
    }
    
    .input-section-card {
        padding: 20px;
    }
    
    .form-control {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

