/* =============================================================================
   AFFILIATE DASHBOARD - SAAS LAYOUT
   Professional sidebar navigation layout
   ============================================================================= */

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

/* Body and Container */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #1E3A8A 0%, #0EA5E9 100%);
    min-height: 100vh;
    line-height: 1.6;
    color: #333;
}

/* =============================================================================
   AUTH CONTAINER STYLES - Keep existing auth forms
   ============================================================================= */

.sam-auth-container {
    max-width: 500px;
    margin: 80px auto;
    font-family: inherit;
    padding: 0 20px;
}

/* reCAPTCHA Styling */
.g-recaptcha {
    margin: 15px 0;
    display: flex;
    justify-content: center;
}

@media (max-width: 480px) {
    .g-recaptcha {
        transform: scale(0.85);
        transform-origin: 0 0;
    }
}

/* Auth Tabs - Modern Style */
.sam-auth-tabs {
    display: flex;
    margin-bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 12px 12px 0 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.sam-auth-tab {
    flex: 1;
    padding: 18px 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: center;
    font-weight: 600;
    color: rgb(76 73 73 / 70%);
    transition: all 0.3s ease;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sam-auth-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #112357;
}

.sam-auth-tab.active {
    background: rgba(255, 255, 255, 0.95);
    color: #1f2937;
    border-bottom: none;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

/* Auth Forms - Glass Cards */
.sam-auth-form {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-top: none;
    padding: 40px;
    border-radius: 0 0 24px 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: fadeInUp 0.5s ease;
}

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

/* Form Groups - Enhanced */
.sam-form-group {
    margin-bottom: 25px;
    position: relative;
}

.sam-form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.sam-form-group input,
.sam-form-group select {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    background: white;
    color: #1f2937;
}

.sam-form-group input:focus,
.sam-form-group select:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.sam-form-group input:required:invalid {
    border-color: #71acf833;
}

.sam-form-group input:required:valid {
    border-color: #34d399;
}

/* Form Row - Responsive Grid */
.sam-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.sam-form-row .sam-form-group {
    margin-bottom: 25px;
}

/* Buttons - Gradient Style */
.sam-btn {
    background: linear-gradient(135deg, #1E3A8A 0%, #0EA5E9 100%);
    color: white;
    padding: 16px 32px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    width: 100%;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(30, 58, 138, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sam-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(30, 58, 138, 0.4);
    text-decoration: none;
    color: white;
}

.sam-btn:active {
    transform: translateY(0);
}

/* Alert Messages - Modern Style */
.sam-error {
    background: #fef2f2;
    color: #dc2626;
    padding: 18px 20px;
    border: 1px solid #fecaca;
    border-radius: 12px;
    margin-bottom: 25px;
    border-left: 4px solid #dc2626;
    font-weight: 500;
}

.sam-success {
    background: #ecfdf5;
    color: #059669;
    padding: 18px 20px;
    border: 1px solid #a7f3d0;
    border-radius: 12px;
    margin-bottom: 25px;
    border-left: 4px solid #059669;
    font-weight: 500;
}

.sam-form-group small {
    color: #6b7280;
    font-size: 0.875rem;
    margin-top: 8px;
    display: block;
}

/* =============================================================================
   VERIFICATION & NOTICE STYLES - Keep existing
   ============================================================================= */

.sam-verification-notice,
.sam-not-affiliate {
    max-width: 600px;
    margin: 80px auto;
    text-align: center;
    font-family: inherit;
    padding: 0 20px;
}

.sam-verification-box,
.sam-contact-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 50px 40px;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: fadeInUp 0.5s ease;
}

.sam-verification-box h3,
.sam-contact-box h3 {
    color: #1f2937;
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 700;
}

.sam-resend-btn {
    background: linear-gradient(135deg, #1E3A8A 0%, #0EA5E9 100%);
    color: white;
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    margin-top: 25px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(30, 58, 138, 0.3);
}

.sam-resend-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(30, 58, 138, 0.4);
}

.sam-logout-link {
    color: #dc2626;
    text-decoration: none;
    margin-left: 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.sam-logout-link:hover {
    text-decoration: underline;
    color: #b91c1c;
}

/* =============================================================================
   NEW SAAS DASHBOARD LAYOUT
   ============================================================================= */

.sam-affiliate-dashboard {
    display: flex;
    min-height: 100vh;
    font-family: inherit;
}

/* Sidebar */
.sam-sidebar {
    width: 260px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

.sam-sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.sam-logo {
    font-size: 20px;
    font-weight: 700;
    color: #1E3A8A;
}

.sam-nav-menu {
    padding: 20px 0;
}

.sam-nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #6b7280;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    cursor: pointer;
}

.sam-nav-item:hover,
.sam-nav-item.active {
    background: rgba(30, 58, 138, 0.1);
    color: #1E3A8A;
    border-left-color: #1E3A8A;
}

.sam-nav-icon {
    width: 16px;
    height: 16px;
    margin-right: 12px;
    display: inline-block;
    color: inherit;
}

/* Main Content */
.sam-main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.sam-user-menu:hover .sam-dropdown-menu {
    display: block;
}
/* Top Header */
.sam-top-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 16px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sam-breadcrumb {
    color: #6b7280;
    font-size: 14px;
}

.sam-user-menu {
    position: relative;
    display: inline-block;
}

.sam-user-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.sam-user-trigger:hover {
    background: rgba(107, 114, 128, 0.1);
}

.sam-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1E3A8A 0%, #0EA5E9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.sam-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    z-index: 1000;
    display: none;
}

.sam-dropdown-menu.show {
    display: block;
}

.sam-dropdown-item {
    display: block;
    padding: 12px 16px;
    color: #374151;
    text-decoration: none;
    transition: background-color 0.2s;
}

.sam-dropdown-item:hover {
    background: #f9fafb;
}

.sam-dropdown-item.logout {
    color: #dc2626;
    border-top: 1px solid #e5e7eb;
}

/* Content Area */
.sam-content-area {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.sam-tab-content {
    display: none;
}

.sam-tab-content.active {
    display: block;
}

.sam-page-title {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 24px;
}

/* Stats Grid */
.sam-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.sam-stat-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 24px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.sam-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #1E3A8A 0%, #0EA5E9 100%);
}

.sam-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.sam-stat-label {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 8px;
}

.sam-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
}

.sam-stat-card small {
    color: #9ca3af;
    font-size: 12px;
    font-weight: 500;
}

/* Content Cards */
.sam-content-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 24px;
}

.sam-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.sam-card-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.sam-card-content {
    padding: 24px;
}

/* Form Elements in Cards */
.sam-content-card .sam-form-group {
    margin-bottom: 16px;
}

.sam-content-card .sam-form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    color: #374151;
}

.sam-content-card .sam-form-group input,
.sam-content-card .sam-form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.sam-content-card .sam-form-group input:focus,
.sam-content-card .sam-form-group select:focus {
    outline: none;
    border-color: #1E3A8A;
}

.sam-content-card .sam-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: auto;
    text-transform: none;
    letter-spacing: normal;
}

.sam-content-card .sam-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(30, 58, 138, 0.3);
}

/* Tables */
.sam-data-table {
    width: 100%;
    border-collapse: collapse;
}

.sam-data-table th,
.sam-data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.sam-data-table th {
    font-weight: 600;
    color: #374151;
    background: #f9fafb;
}

.sam-data-table tbody tr:hover {
    background: rgba(30, 58, 138, 0.02);
}

/* Status Badges */
.sam-status-confirmed {
    color: #059669;
    font-weight: 600;
    background: #ecfdf5;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sam-status-pending {
    color: #dc2626;
    font-weight: 600;
    background: #fef2f2;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Banking form animations */
#other-bank-input {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        max-height: 100px;
        transform: translateY(0);
    }
}

/* Hide reset password form by default */
#reset-password-form.sam-auth-form {
    display: none;
}

#reset-password-form.sam-auth-form.active {
    display: block;
}

/* =============================================================================
   RESPONSIVE DESIGN - Mobile First
   ============================================================================= */

/* Tablet Styles */
@media (max-width: 768px) {
    .sam-sidebar {
        width: 100%;
        height: auto;
    }
    
    .sam-dashboard-container {
        flex-direction: column;
    }
    
    .sam-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .sam-auth-container,
    .sam-verification-notice,
    .sam-not-affiliate {
        margin: 40px auto;
        padding: 0 15px;
    }
    
    .sam-auth-form,
    .sam-verification-box,
    .sam-contact-box {
        padding: 30px 25px;
    }
    
    .sam-form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* Mobile Styles */
@media (max-width: 480px) {
    .sam-content-area {
        padding: 16px;
    }
    
    .sam-page-title {
        font-size: 20px;
    }
    
    .sam-top-header {
        padding: 12px 16px;
    }
    
    .sam-card-content {
        padding: 16px;
    }
    
    .sam-auth-container {
        margin: 20px auto;
        padding: 0 10px;
    }
    
    .sam-auth-form {
        padding: 25px 20px;
    }
}

/* =============================================================================
   UTILITY CLASSES
   ============================================================================= */

.fade-in {
    animation: fadeInUp 0.5s ease;
}

.slide-in {
    animation: slideIn 0.3s ease;
}

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

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

/* Focus States for Accessibility */
button:focus,
input:focus,
select:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .sam-auth-container,
    .sam-affiliate-dashboard {
        background: white;
        box-shadow: none;
    }
    
    .sam-sidebar,
    .sam-top-header {
        display: none;
    }
    
    .sam-main-content {
        margin-left: 0;
    }
}