/* SMR Purchases - Public Styles - Compact Mobile-First Design */

/* Base Styles */
.smrp-purchase-widget,
.smrp-order-history,
.smrp-all-services {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.4;
    color: #333;
    box-sizing: border-box;
}

.smrp-purchase-widget *,
.smrp-order-history *,
.smrp-all-services * {
    box-sizing: border-box;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

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

/* Login Redirect - Compact */
.smrp-login-redirect {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    padding: 20px 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
}

.smrp-login-message {
    text-align: center;
    background: white;
    padding: 25px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    max-width: 280px;
    width: 100%;
}

.smrp-login-message .icon-lock {
    font-size: 36px;
    display: block;
    margin-bottom: 10px;
}

.smrp-login-message h3 {
    color: #333;
    margin: 0 0 8px 0;
    font-size: 18px;
}

.smrp-login-message p {
    color: #666;
    margin: 0 0 15px 0;
    font-size: 13px;
}

.smrp-login-btn {
    display: inline-block;
    padding: 10px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.smrp-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    color: white;
}

/* ===== COMPACT PURCHASE WIDGET ===== */
.smrp-purchase-widget {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 15px;
    animation: fadeIn 0.4s ease;
    max-width: 320px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

/* Widget Header - Compact */
.smrp-widget-header {
    padding: 12px 15px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.smrp-widget-header::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60%;
    height: 100%;
    background: rgba(255,255,255,0.1);
    transform: skewX(-15deg);
    transform-origin: top right;
}

.smrp-platform-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 1;
    color: white;
}

.smrp-platform-badge i {
    font-size: 14px;
    color: white;
}

.smrp-platform-badge span {
    color: white;
}

.smrp-service-title {
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1;
}

.smrp-service-title h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: white;
}

/* Service icon in header - WHITE color */
.smrp-widget-header .service-icon {
    font-size: 16px;
    color: white !important;
}

/* Widget Body - Compact */
.smrp-widget-body {
    padding: 15px;
}

/* Balance Row - Inline Compact */
.smrp-balance-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    margin-bottom: 12px;
}

.balance-item {
    text-align: center;
    flex: 1;
}

.balance-item:first-child {
    border-right: 1px solid #dee2e6;
}

.balance-label {
    display: block;
    font-size: 10px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.balance-value {
    font-size: 16px;
    font-weight: 700;
    color: #28a745;
}

.balance-value i {
    font-size: 12px;
    margin-right: 3px;
}

.rate-value {
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
}

/* Form - Compact */
.smrp-purchase-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.smrp-form-group {
    display: flex;
    flex-direction: column;
}

.smrp-form-group label {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 5px;
    font-weight: 600;
    color: #444;
    font-size: 12px;
}

.smrp-form-group label i {
    font-size: 12px;
    color: #667eea;
}

.smrp-input {
    padding: 10px 12px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    width: 100%;
}

.smrp-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Quantity Input - Compact with Visible Buttons */
.quantity-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty-btn {
    width: 36px;
    height: 36px;
    border: 2px solid #667eea;
    background: white;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #667eea;
    flex-shrink: 0;
}

.qty-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.qty-btn:active {
    transform: scale(0.95);
}

.qty-minus {
    background: #f8f9fa;
}

.qty-plus {
    background: #f8f9fa;
}

.quantity-input {
    flex: 1;
    text-align: center;
    font-weight: 600;
    min-width: 60px;
}

/* Cost Preview - Compact */
.smrp-cost-preview {
    padding: 10px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cost-item,
.balance-after {
    text-align: center;
}

.cost-label,
.after-label {
    font-size: 9px;
    text-transform: uppercase;
    opacity: 0.9;
    display: block;
    margin-bottom: 2px;
}

.cost-value,
.after-value {
    font-size: 16px;
    font-weight: 700;
}

.cost-unit {
    font-size: 10px;
    opacity: 0.9;
}

/* Submit Button - Compact */
.smrp-submit-btn {
    padding: 12px 20px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    width: 100%;
}

.smrp-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

.smrp-submit-btn:disabled {
    background: #adb5bd;
    cursor: not-allowed;
}

.smrp-submit-btn i {
    font-size: 14px;
}

.btn-loader {
    animation: spin 1s linear infinite;
}

/* Insufficient Alert - Compact */
.smrp-insufficient-alert {
    margin-top: 10px;
    padding: 10px;
    background: #fff3cd;
    border-left: 3px solid #ffc107;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.smrp-insufficient-alert i {
    color: #856404;
}

.smrp-insufficient-alert p {
    margin: 0;
    color: #856404;
}

/* ===== ORDER HISTORY - COMPACT ===== */
.smrp-order-history {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    max-width: 400px;
    margin: 0 auto;
}

.smrp-history-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.smrp-history-header h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #333;
    font-size: 18px;
}

.smrp-history-header h2 i {
    color: #667eea;
}

.history-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-select {
    flex: 1;
    min-width: 100px;
    padding: 8px 10px;
    border: 1.5px solid #e0e0e0;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
}

/* Orders Container */
.smrp-orders-container {
    min-height: 150px;
}

.smrp-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Order Card - Compact */
.order-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
    transition: all 0.2s ease;
    animation: slideIn 0.3s ease;
    border-left: 3px solid #667eea;
}

.order-card:hover {
    box-shadow: 0 3px 12px rgba(0,0,0,0.08);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.order-number {
    font-weight: 700;
    color: #667eea;
    font-size: 13px;
}

.order-status {
    padding: 3px 10px;
    border-radius: 12px;
    color: white;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.order-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 12px;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-size: 10px;
    color: #888;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.detail-value {
    font-size: 12px;
    color: #333;
    font-weight: 500;
}

.detail-value a {
    color: #667eea;
    text-decoration: none;
}

/* Order Actions */
.order-actions {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
}

.cancel-order-btn {
    padding: 6px 12px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.cancel-order-btn:hover {
    background: #c82333;
}

/* Pagination - Compact */
.smrp-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-top: 15px;
}

.page-btn {
    padding: 6px 12px;
    background: white;
    border: 1.5px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.page-btn:hover,
.page-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* ===== ALL SERVICES - COMPACT ===== */
.smrp-all-services {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.smrp-services-header {
    text-align: center;
    margin-bottom: 20px;
}

.smrp-services-header h2 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 0 5px 0;
    color: #333;
    font-size: 20px;
}

.smrp-services-header p {
    color: #666;
    font-size: 13px;
    margin: 0;
}

/* Service Tabs - Compact */
.smrp-services-tabs {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 8px 14px;
    background: white;
    border: 1.5px solid #e0e0e0;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tab-btn i {
    font-size: 12px;
}

.tab-btn:hover,
.tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

/* Services Grid - Compact */
.smrp-services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.smrp-service-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    padding: 15px 12px;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.smrp-service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.service-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.platform-badge {
    font-size: 9px;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.platform-badge.instagram {
    background: linear-gradient(45deg, #833AB4, #FD1D1D, #FCB045);
    color: white;
}

.platform-badge.facebook {
    background: #1877F2;
    color: white;
}

.platform-badge.youtube {
    background: #FF0000;
    color: white;
}

.platform-badge.threads {
    background: #000;
    color: white;
}

.smrp-service-card .service-icon {
    font-size: 24px;
}

.smrp-service-card h4 {
    margin: 8px 0;
    color: #333;
    font-size: 13px;
}

.service-details {
    margin-bottom: 10px;
}

.service-rate {
    color: #667eea;
    font-size: 12px;
    margin: 0;
}

.service-purchase-btn {
    display: inline-block;
    padding: 8px 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 15px;
    font-weight: 600;
    font-size: 11px;
    transition: all 0.2s ease;
}

.service-purchase-btn:hover {
    transform: scale(1.05);
    color: white;
}

/* Success Animation */
.success-animation {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.3);
    z-index: 10000;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

.success-icon {
    font-size: 50px;
    color: #28a745;
    display: block;
    margin-bottom: 15px;
}

.success-animation h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 18px;
}

.success-animation p {
    margin: 5px 0;
    color: #666;
    font-size: 13px;
}

/* Notification Styles */
.smrp-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 18px;
    background: #333;
    color: white;
    border-radius: 8px;
    z-index: 10000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 280px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.smrp-notification.show {
    transform: translateX(0);
}

.smrp-notification.smrp-success {
    background: #28a745;
}

.smrp-notification.smrp-error {
    background: #dc3545;
}

.smrp-notification.smrp-warning {
    background: #ffc107;
    color: #333;
}

/* Error/Unavailable States */
.smrp-error,
.smrp-service-unavailable {
    text-align: center;
    padding: 20px;
    background: #f8d7da;
    border-radius: 10px;
    color: #721c24;
}

.smrp-service-unavailable i {
    font-size: 30px;
    display: block;
    margin-bottom: 10px;
}

.no-orders {
    text-align: center;
    padding: 30px;
    color: #666;
    font-size: 14px;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 400px) {
    .smrp-purchase-widget {
        max-width: 100%;
        border-radius: 8px;
    }
    
    .smrp-widget-header {
        padding: 10px 12px;
    }
    
    .smrp-platform-badge {
        font-size: 10px;
    }
    
    .smrp-service-title h3 {
        font-size: 12px;
    }
    
    .smrp-widget-body {
        padding: 12px;
    }
    
    .smrp-balance-row {
        padding: 8px 10px;
    }
    
    .balance-value {
        font-size: 14px;
    }
    
    .rate-value {
        font-size: 12px;
    }
    
    .smrp-input {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .qty-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .smrp-cost-preview {
        padding: 8px 10px;
    }
    
    .cost-value,
    .after-value {
        font-size: 14px;
    }
    
    .smrp-submit-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .smrp-order-history {
        padding: 12px;
        max-width: 100%;
    }
    
    .smrp-history-header h2 {
        font-size: 16px;
    }
    
    .order-card {
        padding: 10px;
    }
    
    .order-number {
        font-size: 12px;
    }
    
    .order-details {
        gap: 6px;
    }
    
    .detail-value {
        font-size: 11px;
    }
    
    .smrp-services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .smrp-service-card {
        padding: 12px 8px;
    }
    
    .smrp-service-card h4 {
        font-size: 11px;
    }
    
    .service-rate {
        font-size: 10px;
    }
}

@media (max-width: 320px) {
    .smrp-services-grid {
        grid-template-columns: 1fr;
    }
    
    .order-details {
        grid-template-columns: 1fr;
    }
    
    .history-filters {
        flex-direction: column;
    }
    
    .filter-select {
        width: 100%;
    }
}

/* Platform-specific header colors */
.smrp-widget-header.instagram {
    background: linear-gradient(45deg, #833AB4, #FD1D1D, #FCB045);
}

.smrp-widget-header.facebook {
    background: #1877F2;
}

.smrp-widget-header.youtube {
    background: #FF0000;
}

.smrp-widget-header.threads {
    background: #000000;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .smrp-purchase-widget,
    .smrp-order-history,
    .smrp-all-services {
        background: #1a1a2e;
        color: #eee;
    }
    
    .smrp-balance-row,
    .order-card,
    .smrp-service-card {
        background: #16213e;
    }
    
    .smrp-input {
        background: #16213e;
        border-color: #0f3460;
        color: #eee;
    }
    
    .smrp-form-group label {
        color: #ddd;
    }
    
    .detail-value,
    .smrp-service-card h4 {
        color: #eee;
    }
}
