/**
 * SPM Global Plugin Styles
 * Consolidated CSS from class-spm-shortcodes.php
 */

/* Import modern fonts and icons */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

/* ==========================================================================
   Invoice Styles
   ========================================================================== */
.spm-invoice-styles body { 
    font-family: Arial, sans-serif; 
    margin: 0; 
    padding: 20px; 
    color: #333; 
}

.spm-invoice-styles .invoice-header { 
    text-align: center; 
    margin-bottom: 30px; 
    border-bottom: 2px solid #333; 
    padding-bottom: 20px; 
}

.spm-invoice-styles .invoice-title { 
    font-size: 24px; 
    font-weight: bold; 
    margin-bottom: 10px; 
}

.spm-invoice-styles .invoice-number { 
    font-size: 18px; 
    color: #666; 
}

.spm-invoice-styles .invoice-details { 
    margin-bottom: 30px; 
}

.spm-invoice-styles .invoice-details table { 
    width: 100%; 
    border-collapse: collapse; 
}

.spm-invoice-styles .invoice-details td { 
    padding: 8px; 
    border-bottom: 1px solid #ddd; 
}

.spm-invoice-styles .invoice-details td:first-child { 
    font-weight: bold; 
    width: 30%; 
}

.spm-invoice-styles .address-section { 
    display: flex; 
    justify-content: space-between; 
    margin-bottom: 30px; 
}

.spm-invoice-styles .address-box { 
    width: 48%; 
}

.spm-invoice-styles .address-title { 
    font-weight: bold; 
    margin-bottom: 10px; 
    color: #333; 
}

.spm-invoice-styles .items-table { 
    width: 100%; 
    border-collapse: collapse; 
    margin-bottom: 30px; 
}

.spm-invoice-styles .items-table th, 
.spm-invoice-styles .items-table td { 
    padding: 12px; 
    text-align: left; 
    border-bottom: 1px solid #ddd; 
}

.spm-invoice-styles .items-table th { 
    background-color: #f8f9fa; 
    font-weight: bold; 
}

.spm-invoice-styles .totals-table { 
    width: 100%; 
    border-collapse: collapse; 
    margin-bottom: 30px; 
}

.spm-invoice-styles .totals-table td { 
    padding: 8px; 
    text-align: right; 
}

.spm-invoice-styles .totals-table td:first-child { 
    text-align: left; 
    font-weight: bold; 
}

.spm-invoice-styles .total-row { 
    font-weight: bold; 
    font-size: 16px; 
    border-top: 2px solid #333; 
}

.spm-invoice-styles .footer { 
    margin-top: 40px; 
    text-align: center; 
    color: #666; 
    font-size: 12px; 
}

/* ==========================================================================
   Admin Styles
   ========================================================================== */
#spm_contributor_redirect .inside {
    margin: 0;
    padding: 0;
}

/* ==========================================================================
   Contributor Form Styles
   ========================================================================== */

.spm-contributor-form-section {
    max-width: 650px;
    margin: 40px auto;
    padding: 40px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.1),
        0 15px 25px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    position: relative;
    overflow: hidden;
}

.spm-contributor-form-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.2) 0%, 
        rgba(255, 255, 255, 0.8) 50%, 
        rgba(255, 255, 255, 0.2) 100%);
}

.spm-form-header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.spm-form-header::before {
    content: '\f030';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 2.5rem;
    display: block;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.9);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.spm-form-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 12px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.02em;
}

.spm-form-header .subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    font-weight: 400;
    line-height: 1.5;
}

.spm-contributor-form {
    margin-top: 30px;
}

.spm-form-group {
    margin-bottom: 25px;
    position: relative;
}

.spm-form-row {
    display: flex;
    gap: 20px;
}

.spm-form-group.half {
    flex: 1;
}

.spm-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 13px;
    letter-spacing: 0.01em;
}

.spm-form-group input,
.spm-form-group select,
.spm-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.05);
    box-sizing: border-box;
    backdrop-filter: blur(10px);
}

.spm-form-group input::placeholder,
.spm-form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
    font-weight: 300;
}

.spm-form-group input:focus,
.spm-form-group select:focus,
.spm-form-group textarea:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 0 0 4px rgba(255, 255, 255, 0.1),
        0 8px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.spm-form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 16 16'%3e%3cpath d='m7.247 4.86-4.796 5.481c-.566.647-.106 1.659.753 1.659h9.592a1 1 0 0 0 .753-1.659l-4.796-5.48a1 1 0 0 0-1.506 0z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    padding-right: 45px;
}

.spm-form-group select option {
    background: #2c3e50;
    padding: 10px;
}

.spm-form-group textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

.spm-checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.spm-checkbox-group label {
    display: flex;
    align-items: center;
    font-weight: 400;
    margin-bottom: 0;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
}

.spm-checkbox-group label:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.spm-checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
}

.spm-checkbox-group input[type="checkbox"]:checked {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.9);
}

.spm-submit-btn {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
}

.spm-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.6);
}

.spm-submit-btn:active {
    transform: translateY(0);
}

.spm-submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.spm-submit-btn:hover::before {
    left: 100%;
}

.spm-loading {
    display: none;
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.9);
}

.spm-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spm-loading p {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

.spm-error-message {
    background: rgba(220, 53, 69, 0.9);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    border: 1px solid rgba(220, 53, 69, 1);
    backdrop-filter: blur(10px);
}

.spm-success-message {
    animation: slideInUp 0.5s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Statistics Cards
   ========================================================================== */
.spm-statistics-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.spm-history-stats .fas{
    font-size: 24px;
    
}
.spm-stat-icon-dark.fas{
    font-size: 24px;

}
.spm-stat-card:nth-child(2) {
    background: transparent;
}

.spm-stat-card:nth-child(3) {
    background: transparent;
}

.spm-stat {
    color: white !important;
}

.spm-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

.spm-stat-number {
    display: block;
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.spm-stat-label {
    font-size: 16px;
    font-weight: 500;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.spm-stat-icon {
    font-size: 24px;
    margin-bottom: 10px;
    opacity: 0.8;
    color: white;
}

.spm-stat-card .fas {
  font-size: 2.2em;
  font-weight: 700;
  line-height: 1.1;
}


      .spm-statistics-container {
                    display: flex;
                    flex-wrap: wrap;
                    gap: 20px;
                    margin: 20px 0;
                    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
                }
                
                .spm-stat-card {
                    flex: 1;
                    min-width: 200px;
                    background: transparent;
                    border-radius: 12px;
                    padding: 25px 20px;
                    text-align: center;
                    color: white;
                    box-shadow: none;
                    transition: transform 0.3s ease, box-shadow 0.3s ease;
                    border: 1px solid #fff;
                }
                
                .spm-stat-card:nth-child(2) {
                    background: transparent;
                    border: 1px solid #fff;
                }
                
                .spm-stat-card:nth-child(3) {
                    background: transparent;
                    border: 1px solid #fff;
                }
                
                .spm-stat-card:hover {
                    transform: translateY(-5px);
                    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
                }
                
                .spm-stat-number {
                    display: block;
                    font-size: 48px;
                    font-weight: 700;
                    line-height: 1;
                    margin-bottom: 8px;
                    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
                }
                
                .spm-stat-label {
                    font-size: 16px;
                    font-weight: 500;
                    opacity: 0.9;
                    text-transform: uppercase;
                    letter-spacing: 1px;
                }
                
                .spm-stat-icon {
                    font-size: 24px;
                    margin-bottom: 10px;
                    opacity: 0.8;
                    color: white;
                }
                
                @media (max-width: 768px) {
                    .spm-statistics-container {
                        flex-direction: column;
                        gap: 15px;
                    }
                    
                    .spm-stat-card {
                        min-width: unset;
                    }
                    
                    .spm-stat-number {
                        font-size: 36px;
                    }
                }
            

/* ==========================================================================
   Modern Earnings Dashboard
   ========================================================================== */
.spm-modern-earnings {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8fafc;
    min-height: 80vh;
    padding: 2rem 0;
}

.spm-earnings-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ==========================================================================
   Responsive Styles
   ========================================================================== */
@media (max-width: 768px) {
    /* Contributor Form Mobile */
    .spm-contributor-form-section {
        margin: 20px;
        padding: 30px 20px;
    }
    
    .spm-form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .spm-form-group.half {
        margin-bottom: 25px;
    }
    
    .spm-form-header h2 {
        font-size: 1.75rem;
    }
    
    .spm-checkbox-group {
        grid-template-columns: 1fr;
    }
    
    .spm-form-group input,
    .spm-form-group select,
    .spm-form-group textarea {
        padding: 12px 14px;
        font-size: 14px;
    }
    
    /* Statistics Mobile */
    .spm-statistics-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .spm-stat-card {
        min-width: unset;
    }
    
    .spm-stat-number {
        font-size: 36px;
    }
}

/* ==========================================================================
   Dark Theme Support
   ========================================================================== */
@media (prefers-color-scheme: dark) {
    .spm-contributor-form-section {
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(255, 255, 255, 0.15);
    }
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */
.spm-text-center {
    text-align: center;
}

.spm-p-2 {
    padding: 2rem;
}

.spm-mb-0 {
    margin-bottom: 0;
}

.spm-hidden {
    display: none;
}

.spm-flex {
    display: flex;
}

.spm-justify-center {
    justify-content: center;
}

.spm-items-center {
    align-items: center;
}

/* ==========================================================================
   Login Form Text Color Fixes
   ========================================================================== */

/* Make login form labels gray instead of white */
.spm-auth-form .spm-form-label {
    color: #6b7280 !important;
    font-weight: 500;
}

/* Make login form input placeholders gray */
.spm-auth-form .spm-form-input::placeholder {
    color: #9ca3af !important;
}

/* Make login form input text dark */
.spm-auth-form .spm-form-input {
    color: #374151 !important;
}

/* Make checkbox label text gray */
.spm-auth-form .spm-checkbox-label span {
    color: #6b7280 !important;
}

/* Make button text white (keep this for contrast) */
.spm-auth-form .spm-btn-primary {
    color: white !important;
}

/* Make divider text gray */
.spm-auth-form .spm-divider {
    color: #9ca3af !important;
}

/* Make error messages dark */
.spm-auth-form .spm-notice-error {
    color: #dc2626 !important;
}

/* Make success messages dark */
.spm-auth-form .spm-notice-success {
    color: #059669 !important;
}

/* Remove blue border/outline on button hover and focus */
.spm-auth-form .spm-btn-primary:focus,
.spm-auth-form .spm-btn-primary:hover:focus,
.spm-auth-form .spm-btn-primary:active:focus {
    outline: none !important;
    border: none !important;
    box-shadow: 0 8px 20px rgba(33, 197, 93, 0.10) !important;
}

/* Remove any default browser focus styles */
.spm-auth-form .spm-btn-primary:focus-visible {
    outline: none !important;
    border: none !important;
}



.spm-download-actions .spm-btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 10px;
    text-align: center;
    padding: 3px;
}

.spm-download-actions .spm-btn-sm .fas.fa-download{
    margin-right: 0.5rem;
    font-size: 10px;
}

/* Search Button Styling - Maintain purple color #6f20bf */
.spm-search-btn {
    background: #6f20bf !important;
    color: white !important;
    border: none !important;
    padding: 8px 16px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-weight: 500 !important;
    transition: background-color 0.2s ease !important;
}

.spm-search-btn:hover {
    background: #5a1a9f !important;
}