/**
 * Crypto Exchange General Settings - Modern Responsive Theme
 * Wallet Generator Design Pattern Implementation
 * 
 * Table of Contents:
 * 1. Base Layout & Reset
 * 2. Header Component  
 * 3. Container System
 * 4. Card Components
 * 5. Form Elements
 * 6. Button Styles
 * 7. Status Indicators
 * 8. Responsive Design
 * 9. Animations & Effects
 * 10. Component Specific Styles
 */

/* ============================================================================
   1. Base Layout & Reset
   ============================================================================ */

.wrap,
.wrap * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.wrap {
    width: 100%;
    padding: 20px;
    margin: 20px auto;
    max-width: calc(100vw - 200px);
}

.folded .wrap {
    max-width: calc(100vw - 160px);
}

@media (max-width: 1200px) {
    .wrap {
        max-width: calc(100vw - 120px);
    }

    .folded .wrap {
        max-width: calc(100vw - 100px);
    }
}

@media (max-width: 960px) {
    .wrap {
        max-width: calc(100vw - 80px);
    }

    .folded .wrap {
        max-width: calc(100vw - 60px);
    }
}

@media (max-width: 768px) {
    .wrap {
        max-width: calc(100vw - 40px);
        margin: 15px auto;
        padding: 15px;
    }

    .folded .wrap {
        max-width: calc(100vw - 30px);
    }
}

@media (max-width: 600px) {
    .wrap {
        max-width: calc(100vw - 20px);
        margin: 10px auto;
        padding: 12px;
    }

    .folded .wrap {
        max-width: calc(100vw - 15px);
    }
}

@media (max-width: 480px) {
    .wrap {
        max-width: calc(100vw - 10px);
        margin: 5px auto;
        padding: 10px;
    }

    .folded .wrap {
        max-width: calc(100vw - 5px);
    }
}

/* ============================================================================
   2. Header Component
   ============================================================================ */

.mfcrex-header-info {
    background: linear-gradient(135deg, #1e3c72, #667eea);
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.mfcrex-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 45px;
    margin-bottom: 15px;
    gap: 15px;
}

.mfcrex-header-left {
    flex: 0 0 auto;
    margin-right: auto;
}

.mfcrex-header-center {
    flex: 0 0 auto;
}

.mfcrex-header-logo {
    height: 32px;
    width: auto;
}

.mfcrex-header-title {
    font-size: 22px;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    margin: 0;
}

.mfcrex-header-info hr {
    border: none;
    height: 1px;
    background: rgba(255, 255, 255, 0.3);
    margin: 15px 0;
}

.mfcrex-info-content {
    line-height: 1.6;
}

.mfcrex-info-content p {
    margin-bottom: 15px;
}

.mfcrex-info-content p:last-child {
    margin-bottom: 0;
}

/* ============================================================================
   3. Container System
   ============================================================================ */

.mfcrex-general-settings-admin-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.mfcrex-general-settings-main-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ============================================================================
   4. Card Components
   ============================================================================ */

.mfcrex-general-settings-admin-card,
.mfcrex-settings-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.mfcrex-general-settings-admin-card:hover,
.mfcrex-settings-section:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border-color: #d1d5db;
}

.mfcrex-general-settings-admin-card-header,
.mfcrex-settings-section h3 {
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 3px solid;
    border-image: linear-gradient(90deg, #6366f1, #ec4899, #06b6d4) 1;
}

.mfcrex-general-settings-admin-card-header h2,
.mfcrex-general-settings-admin-card-header h3,
.mfcrex-settings-section h3 {
    margin: 0 0 6px 0;
    color: #1f2937;
    font-size: 18px;
    font-weight: 700;
}

.mfcrex-general-settings-admin-card-header p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
}

/* ============================================================================
   5. Form Elements
   ============================================================================ */

.mfcrex-general-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.mfcrex-general-settings-field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mfcrex-general-settings-field-group label {
    font-weight: 600;
    color: #374151;
    font-size: 14px;
    margin-bottom: 4px;
}

.mfcrex-general-settings-field-group input,
.mfcrex-general-settings-field-group select,
.mfcrex-general-settings-field-group textarea {
    padding: 10px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    transition: all 0.2s ease;
}

.mfcrex-general-settings-field-group input:focus,
.mfcrex-general-settings-field-group select:focus,
.mfcrex-general-settings-field-group textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background: #fefeff;
}

.mfcrex-general-settings-field-group input[type="password"] {
    letter-spacing: 1px;
}

.mfcrex-general-settings-field-group input[type="number"] {
    text-align: right;
}

.mfcrex-general-settings-field-group input[readonly] {
    background: #f9fafb;
    color: #6b7280;
    cursor: default;
    border-color: #e5e7eb;
}

.mfcrex-general-settings-field-group small {
    color: #6b7280;
    font-size: 12px;
    line-height: 1.4;
    margin-top: 2px;
}

/* ============================================================================
   6. Button Styles
   ============================================================================ */

.mfcrex-general-settings-form-actions {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 2px solid #f3f4f6;
    text-align: center;
}

.mfcrex-general-settings-form-actions .button-primary {
    background: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
    border: none;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    text-decoration: none;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.mfcrex-general-settings-form-actions .button-primary:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #be185d 100%);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.button {
    padding: 8px 14px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: white;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.button:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    transform: translateY(-1px);
}

.button-primary {
    background: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
    border-color: transparent;
    color: white;
}

.button-primary:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #be185d 100%);
    color: white;
}

.button-secondary {
    background: #6b7280;
    border-color: #6b7280;
    color: white;
}

.button-secondary:hover {
    background: #4b5563;
    border-color: #4b5563;
    color: white;
}

/* ============================================================================
   7. Webhook Controls
   ============================================================================ */

.webhook-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}


/* ============================================================================
   8. Admin Messenger Components
   ============================================================================ */

.admin-telegram-container {
    border: 1px solid #e5e7eb;
    padding: 16px;
    border-radius: 6px;
    background: #f9fafb;
}

.admin-telegram-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.admin-header-content h4 {
    margin: 0 0 4px 0;
    color: #1f2937;
    font-size: 16px;
    font-weight: 600;
}

.admin-header-content p {
    margin: 0;
    color: #6b7280;
    font-size: 13px;
}

.admin-status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.admin-status-active {
    background: #dcfce7;
    color: #166534;
}

.admin-status-inactive {
    background: #fef2f2;
    color: #991b1b;
}

.admin-telegram-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 16px;
}

.admin-subscription-details {
    background: #f9fafb;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 12px;
}

.admin-detail-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.admin-detail-item:last-child {
    margin-bottom: 0;
}

.admin-detail-label {
    font-weight: 600;
    color: #4b5563;
}

.admin-detail-value {
    color: #1f2937;
}

.admin-status-text {
    color: #10b981;
    font-weight: 600;
}

.admin-unsubscribe-section {
    background: #fef2f2;
    padding: 12px;
    border-radius: 4px;
    border: 1px solid #fecaca;
}

.admin-unsubscribe-section h6 {
    margin: 0 0 6px 0;
    color: #991b1b;
    font-weight: 600;
}

.admin-unsubscribe-warning {
    margin: 0 0 10px 0;
    color: #991b1b;
    font-size: 12px;
}

.admin-unsubscribe-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.admin-unsubscribe-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.admin-subscribe-section {
    background: #eff6ff;
    padding: 16px;
    border-radius: 4px;
    text-align: center;
}

.admin-subscribe-section h6 {
    margin: 0 0 8px 0;
    color: #1e40af;
    font-weight: 600;
}

.admin-subscribe-section p {
    margin: 0 0 12px 0;
    color: #1e40af;
    font-size: 13px;
}

.admin-subscribe-btn {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    color: white;
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s ease;
    margin-bottom: 12px;
}

.admin-subscribe-btn:hover {
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.admin-subscribe-steps {
    background: white;
    padding: 12px;
    border-radius: 4px;
    text-align: left;
}

.admin-subscribe-steps h6 {
    margin: 0 0 8px 0;
    color: #1f2937;
    font-weight: 600;
}

.admin-subscribe-steps ol {
    margin: 0;
    padding-left: 14px;
    color: #6b7280;
}

.admin-subscribe-steps li {
    margin-bottom: 4px;
    font-size: 12px;
    line-height: 1.3;
}

.admin-not-configured {
    background: #fef2f2;
    padding: 12px;
    border-radius: 4px;
}

.admin-not-configured p {
    margin: 0;
    color: #991b1b;
}

/* ============================================================================
   9. Coupon Management
   ============================================================================ */

.mfcrex-coupon-container {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 16px;
    margin-top: 12px;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.mfcrex-coupon-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #6366f1;
}

.mfcrex-coupon-header h4 {
    margin: 0;
    color: #6366f1;
    font-size: 18px;
    font-weight: 700;
}

#mfcrex-add-coupon-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    color: white;
    padding: 10px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

#mfcrex-add-coupon-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.mfcrex-coupon-item {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.mfcrex-coupon-item:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.mfcrex-coupon-fields {
    display: grid;
    grid-template-columns: 1fr 180px 100px;
    gap: 16px;
    align-items: end;
}

.mfcrex-coupon-field label {
    display: block;
    font-weight: 700;
    color: #4b5563;
    margin-bottom: 6px;
    font-size: 13px;
}

.mfcrex-coupon-field input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    font-size: 13px;
    transition: all 0.2s ease;
    background: #ffffff;
}

.mfcrex-coupon-field input:focus {
    border-color: #6366f1;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background: #fefeff;
}

.mfcrex-coupon-field small {
    display: block;
    color: #6b7280;
    font-size: 11px;
    margin-top: 4px;
    font-style: italic;
}

.mfcrex-remove-coupon-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    height: fit-content;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.mfcrex-remove-coupon-btn:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.mfcrex-coupon-instructions {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border: 2px solid #3b82f6;
    border-radius: 6px;
    padding: 16px;
    margin-top: 20px;
}

.mfcrex-coupon-instructions h6 {
    color: #1e40af;
    margin: 0 0 12px 0;
    font-size: 15px;
    font-weight: 700;
}

.mfcrex-coupon-instructions ul {
    margin: 0;
    padding-left: 20px;
    color: #374151;
}

.mfcrex-coupon-instructions li {
    margin-bottom: 6px;
    font-size: 13px;
    line-height: 1.5;
}

/* ============================================================================
   10. Messages & Feedback
   ============================================================================ */

.mfcrex-message {
    padding: 16px;
    border-radius: 6px;
    margin: 20px 0;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    animation: mfcrex-fadeIn 0.3s ease;
}

.mfcrex-message.success {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
    border: 1px solid #bbf7d0;
    box-shadow: 0 2px 4px rgba(22, 101, 52, 0.1);
}

.mfcrex-message.error {
    background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
    color: #991b1b;
    border: 1px solid #fecaca;
    box-shadow: 0 2px 4px rgba(153, 27, 27, 0.1);
}

.mfcrex-warning-text {
    color: #dc2626;
    font-weight: 500;
    background: #fef2f2;
    padding: 8px 12px;
    border-radius: 6px;
    border-left: 4px solid #dc2626;
    margin-top: 8px;
    display: block;
}

.mfcrex-info-text {
    color: #059669;
    background: #f0fdf4;
    padding: 8px 12px;
    border-radius: 6px;
    border-left: 4px solid #059669;
    margin-top: 8px;
    display: block;
}

/* ============================================================================
   11. Responsive Design
   ============================================================================ */

@media (max-width: 768px) and (min-width: 481px) {
    .mfcrex-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .mfcrex-header-left {
        margin-right: 0;
    }

    .mfcrex-header-title {
        font-size: 18px;
    }

    .mfcrex-general-settings-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .mfcrex-coupon-fields {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .mfcrex-coupon-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    #mfcrex-add-coupon-btn {
        width: 100%;
        text-align: center;
    }

    .webhook-buttons {
        flex-direction: column;
    }

    .webhook-buttons .button {
        width: 100%;
        justify-content: center;
    }

    .admin-telegram-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .admin-status-badge {
        align-self: flex-start;
    }

    .admin-detail-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
    }
}

@media (max-width: 480px) {
    .mfcrex-header {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .mfcrex-header-left {
        margin-right: 0;
    }

    .mfcrex-header-title {
        font-size: 16px;
    }

    .mfcrex-general-settings-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .mfcrex-coupon-fields {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .mfcrex-coupon-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    #mfcrex-add-coupon-btn {
        width: 100%;
        text-align: center;
    }

    .webhook-buttons {
        flex-direction: column;
    }

    .webhook-buttons .button {
        width: 100%;
        justify-content: center;
    }

    .admin-telegram-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .admin-detail-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
    }
}

/* ============================================================================
   12. Animations & Effects
   ============================================================================ */

@keyframes mfcrex-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

@keyframes mfcrex-fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes mfcrex-spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.mfcrex-general-settings-admin-card {
    animation: mfcrex-fadeIn 0.3s ease;
}

.mfcrex-loading {
    position: relative;
    opacity: 0.7;
}

.mfcrex-loading::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: mfcrex-spin 1s linear infinite;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* ============================================================================
   13. PRO Features Sections
   ============================================================================ */

.mfcrex-pro-section {
    position: relative;
    overflow: hidden;
}

.mfcrex-pro-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(0.5px);
    z-index: 10;
    pointer-events: none;
}

.mfcrex-pro-section::after {
    content: '🔒 PRO VERSION FEATURE';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    z-index: 11;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    letter-spacing: 1px;
}

.mfcrex-pro-section .mfcrex-general-settings-field-group input,
.mfcrex-pro-section .mfcrex-general-settings-field-group select,
.mfcrex-pro-section .mfcrex-general-settings-field-group textarea,
.mfcrex-pro-section button,
.mfcrex-pro-section .button {
    pointer-events: none !important;
    opacity: 0.7;
    cursor: not-allowed !important;
}

.mfcrex-pro-section .mfcrex-general-settings-field-group label {
    opacity: 0.85;
}

.mfcrex-pro-section .mfcrex-general-settings-field-group small {
    opacity: 0.75;
}

/* PRO Badge for section headers */
.mfcrex-pro-badge {
    display: inline-block;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    margin-left: 8px;
    letter-spacing: 0.5px;
    vertical-align: middle;
}

/* ============================================================================
   14. Accessibility & High Contrast
   ============================================================================ */

@media (prefers-contrast: high) {
    .mfcrex-general-settings-admin-card {
        border: 2px solid #000;
    }

    .mfcrex-general-settings-field-group input,
    .mfcrex-general-settings-field-group select,
    .mfcrex-general-settings-field-group textarea {
        border: 2px solid #000;
    }

    .mfcrex-general-settings-field-group input:focus,
    .mfcrex-general-settings-field-group select:focus,
    .mfcrex-general-settings-field-group textarea:focus {
        border-color: #000;
        box-shadow: 0 0 0 3px #ffff00;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms;
        animation-iteration-count: 1;
        transition-duration: 0.01ms;
    }
}