/* Import Google Fonts - Kufi Arabic */
@import url('https://fonts.googleapis.com/css2?family=Noto+Kufi+Arabic:wght@400;500;600;700&display=swap');

/* Frontend Styles */
.cpm-frontend-container {
    max-width: 700px;
    margin: 20px auto;
    padding: 15px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
}

/* Arabic Kufi Font */
.cpm-lang-ar {
    font-family: 'Noto Kufi Arabic', 'Arial', sans-serif;
}

.cpm-frontend-container[style*="rtl"] .cpm-frontend-container,
.cpm-frontend-container[style*="rtl"] .cpm-frontend-card,
.cpm-frontend-container[style*="rtl"] *:not(.dashicons) {
    font-family: 'Noto Kufi Arabic', 'Arial', sans-serif;
}

.cpm-frontend-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.cpm-frontend-header {
    background: linear-gradient(135deg, #01bfbc 0%, #018f8d 100%);
    padding: 25px 20px;
    text-align: center;
    color: white;
}

.cpm-frontend-header h2 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 700;
}

.cpm-frontend-header p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
}

#cpm-order-form {
    padding: 25px 20px;
}

.cpm-form-section {
    margin-bottom: 25px;
}

.cpm-form-section h3 {
    margin: 0 0 15px 0;
    color: #1e293b;
    font-size: 17px;
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 2px solid #01bfbc;
    display: inline-block;
}

.cpm-form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.cpm-form-group {
    margin-bottom: 12px;
}

.cpm-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #334155;
    font-size: 13px;
}

.cpm-form-group input[type="text"],
.cpm-form-group input[type="email"] {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    background: #f8fafc;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.cpm-form-group input[readonly] {
    cursor: not-allowed;
    opacity: 0.7;
}

.cpm-form-group input:focus {
    outline: none;
    border-color: #01bfbc;
    background: white;
}

/* Package Cards */
.cpm-packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.cpm-package-card {
    position: relative;
    cursor: pointer;
}

.cpm-package-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.cpm-package-content {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px 12px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.cpm-package-card:hover .cpm-package-content {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(1, 191, 188, 0.2);
}

.cpm-package-card input[type="radio"]:checked + .cpm-package-content {
    background: linear-gradient(135deg, #01bfbc 0%, #018f8d 100%);
    border-color: #01bfbc;
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(1, 191, 188, 0.4);
}

.cpm-package-duration {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.cpm-package-card input[type="radio"]:checked + .cpm-package-content .cpm-package-duration {
    color: white;
}

.cpm-package-original-price {
    font-size: 16px;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 4px;
    position: relative;
    display: inline-block;
}

.cpm-package-original-price::before {
    content: '';
    position: absolute;
    left: -5%;
    right: -5%;
    top: 50%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #ef4444, transparent);
    transform: translateY(-50%) rotate(-5deg);
    border-radius: 2px;
}

.cpm-package-card input[type="radio"]:checked + .cpm-package-content .cpm-package-original-price {
    color: rgba(255, 255, 255, 0.7);
}

.cpm-package-card input[type="radio"]:checked + .cpm-package-content .cpm-package-original-price::before {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
}

.cpm-package-price {
    font-size: 24px;
    font-weight: 700;
    color: #01bfbc;
    margin-bottom: 6px;
}

.cpm-package-card input[type="radio"]:checked + .cpm-package-content .cpm-package-price {
    color: white;
}

.cpm-package-price span {
    font-size: 13px;
    font-weight: 500;
}

.cpm-package-discount {
    display: inline-block;
    background: #10b981;
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin: 6px 0;
}

.cpm-package-card input[type="radio"]:checked + .cpm-package-content .cpm-package-discount {
    background: rgba(255, 255, 255, 0.3);
}

/* Price Summary Table */
.cpm-summary-table {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 10px;
    padding: 15px;
    border: 2px solid #e2e8f0;
}

.cpm-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #cbd5e1;
    font-size: 14px;
}

.cpm-summary-row:last-child {
    border-bottom: none;
}

.cpm-summary-row span {
    color: #475569;
    font-weight: 500;
}

.cpm-summary-row strong {
    color: #1e293b;
    font-size: 15px;
}

.cpm-discount-row strong {
    color: #10b981;
}

.cpm-total-row {
    background: linear-gradient(135deg, #01bfbc 0%, #018f8d 100%);
    margin: 12px -15px -15px -15px;
    padding: 15px !important;
    border-radius: 0 0 10px 10px;
    border-bottom: none !important;
}

.cpm-total-row span,
.cpm-total-row strong {
    color: white;
    font-size: 16px;
}

.cpm-final-price {
    font-size: 22px !important;
    font-weight: 700 !important;
}

/* File Upload */
.cpm-file-upload {
    display: block;
    position: relative;
    cursor: pointer;
}

.cpm-file-upload input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.cpm-file-upload-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 15px;
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    transition: all 0.3s ease;
    text-align: center;
}

.cpm-file-upload:hover .cpm-file-upload-text {
    border-color: #01bfbc;
    background: #f0f4ff;
}

.cpm-file-upload-text .dashicons {
    font-size: 36px;
    width: 36px;
    height: 36px;
    color: #01bfbc;
    margin-bottom: 10px;
}

.cpm-file-upload-text #cpm-file-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    display: block;
    margin-bottom: 6px;
}

.cpm-file-upload-text small {
    color: #64748b;
    font-size: 12px;
}

/* Progress Bar */
#cpm-upload-progress {
    margin-top: 15px;
}

.cpm-progress-bar {
    width: 100%;
    height: 24px;
    background: #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.cpm-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #01bfbc 0%, #018f8d 100%);
    border-radius: 15px;
    transition: width 0.3s ease;
    width: 0%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cpm-progress-text {
    text-align: center;
    margin-top: 10px;
    font-weight: 600;
    color: #01bfbc;
    font-size: 16px;
}

/* Submit Button */
.cpm-form-actions {
    text-align: center;
    margin-top: 25px;
}

.cpm-submit-btn {
    background: linear-gradient(135deg, #01bfbc 0%, #018f8d 100%);
    color: white;
    border: none;
    padding: 12px 35px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 6px 20px rgba(1, 191, 188, 0.3);
}

.cpm-submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(1, 191, 188, 0.5);
}

.cpm-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.cpm-submit-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Messages */
#cpm-frontend-message {
    margin-bottom: 20px;
}

.cpm-frontend-success {
    background: #d1fae5;
    color: #065f46;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #10b981;
    font-weight: 600;
    font-size: 14px;
}

.cpm-frontend-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #ef4444;
    font-weight: 600;
    font-size: 14px;
}

/* Success Popup */
.cpm-success-popup {
    text-align: center;
    padding: 40px 25px;
    animation: fadeInScale 0.5s ease;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.cpm-success-icon {
    margin: 0 auto 20px;
    animation: checkmark 0.8s ease;
}

.cpm-success-icon svg {
    width: 60px;
    height: 60px;
}

@keyframes checkmark {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.cpm-success-popup h2 {
    color: #10b981;
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 12px 0;
}

.cpm-success-popup p {
    color: #475569;
    font-size: 15px;
    margin: 8px 0;
}

.cpm-success-note {
    color: #64748b !important;
    font-size: 13px !important;
    margin-top: 15px !important;
}

/* Bank Info Table */
.cpm-bank-info-table {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.cpm-bank-info-table table {
    width: 100%;
    border-collapse: collapse;
}

.cpm-bank-info-table tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.cpm-bank-info-table tbody tr:last-child {
    border-bottom: none;
}

.cpm-bank-info-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(1, 191, 188, 0.05) 0%, rgba(1, 143, 141, 0.05) 100%);
}

.cpm-bank-info-table td {
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.4;
}

.cpm-bank-info-table td:first-child {
    width: 130px;
    background: linear-gradient(135deg, #01bfbc 0%, #018f8d 100%);
    color: white;
    font-weight: 600;
    border-right: 2px solid #01bfbc;
}

.cpm-bank-info-table td:first-child strong {
    color: white;
}

.cpm-bank-info-table td:last-child {
    color: #1e293b;
    font-weight: 500;
    background: white;
}

.cpm-bank-info-table tbody tr:nth-child(even) td:last-child {
    background: #f8fafc;
}

/* Language Toggle Button */
.cpm-lang-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.cpm-lang-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.cpm-lang-icon {
    font-size: 16px;
}

.cpm-frontend-header {
    position: relative;
}

/* Responsive */
@media (max-width: 768px) {
    .cpm-frontend-container {
        padding: 10px;
        margin: 15px auto;
    }
    
    .cpm-frontend-header {
        padding: 20px 15px;
    }
    
    .cpm-frontend-header h2 {
        font-size: 20px;
    }
    
    .cpm-frontend-header p {
        font-size: 13px;
    }
    
    #cpm-order-form {
        padding: 20px 15px;
    }
    
    .cpm-form-section {
        margin-bottom: 20px;
    }
    
    .cpm-form-section h3 {
        font-size: 16px;
    }
    
    .cpm-form-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .cpm-packages-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .cpm-package-content {
        padding: 15px 10px;
        min-height: 130px;
    }
    
    .cpm-package-duration {
        font-size: 14px;
    }
    
    .cpm-package-price {
        font-size: 20px;
    }
    
    .cpm-success-popup {
        padding: 30px 20px;
    }
    
    .cpm-success-popup h2 {
        font-size: 20px;
    }
    
    .cpm-success-popup p {
        font-size: 14px;
    }
    
    .cpm-bank-info-table td {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .cpm-bank-info-table td:first-child {
        width: auto;
        display: block;
        border-right: none;
        border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    }
    
    .cpm-bank-info-table td:last-child {
        display: block;
        padding-top: 8px;
    }
    
    .cpm-submit-btn {
        padding: 11px 30px;
        font-size: 15px;
    }
    
    .cpm-lang-btn {
        top: 12px;
        right: 12px;
        padding: 5px 12px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .cpm-frontend-container {
        padding: 8px;
        margin: 10px auto;
    }
    
    .cpm-frontend-header {
        padding: 18px 12px;
    }
    
    .cpm-frontend-header h2 {
        font-size: 18px;
    }
    
    #cpm-order-form {
        padding: 18px 12px;
    }
    
    .cpm-packages-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cpm-package-content {
        padding: 18px 15px;
    }
    
    .cpm-file-upload-text {
        padding: 25px 12px;
    }
}

