/**
 * SD Orders Module Styles
 * Styles for plan management, PayPal integration, and order interface
 */

/* Plan Information Styles */
.sd-amp-plan-info {
    margin-top: 10px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #007cba;
}

.sd-amp-plan-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    color: white;
}

.sd-amp-plan-badge.plan_basic {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
}

.sd-amp-plan-badge.plan_standard {
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
}

.sd-amp-plan-badge.plan_premium {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
}

.sd-amp-plan-badge i {
    font-size: 14px;
}

/* Upgrade Button Styles */
.sd-amp-upgrade-plan-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
    color: white !important;
    border: none !important;
    padding: 6px 12px !important;
    border-radius: 4px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
}

.sd-amp-upgrade-plan-btn:hover {
    background: linear-gradient(135deg, #20c997 0%, #28a745 100%) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3) !important;
}

/* Plan Upgrade Section */
.sd-plan-upgrade-section {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.sd-plan-current {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 6px;
    border: 2px solid #007cba;
}

.sd-plan-current h3 {
    color: #007cba;
    margin: 0 0 10px 0;
    font-size: 1.2em;
}

.sd-plan-upgrade-options h4 {
    text-align: center;
    margin-bottom: 20px;
    color: #495057;
}

/* Plan Cards */
.sd-plan-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.sd-plan-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.sd-plan-card:hover {
    border-color: #007cba;
    box-shadow: 0 8px 25px rgba(0, 124, 186, 0.15);
    transform: translateY(-2px);
}

.sd-plan-card.current {
    border-color: #28a745;
    background: linear-gradient(135deg, #f8fff9 0%, #e8f5e8 100%);
}

.sd-plan-card.current::before {
    content: 'Plan Actual';
    position: absolute;
    top: 10px;
    right: 10px;
    background: #28a745;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
}

.sd-plan-header {
    text-align: center;
    margin-bottom: 15px;
}

.sd-plan-header h5 {
    margin: 0 0 10px 0;
    font-size: 1.3em;
    color: #495057;
}

.sd-plan-price {
    font-size: 1.8em;
    font-weight: bold;
    color: #007cba;
}

.sd-plan-price .sd-plan-base-price,
.sd-plan-option-price .sd-plan-base-price {
    display: block;
    font-size: 0.6em;
    color: #6c757d;
    text-decoration: line-through;
    margin-top: 4px;
}

.sd-plan-price .sd-plan-discount-badge,
.sd-plan-option-price .sd-plan-discount-badge {
    display: inline-block;
    margin-left: 8px;
    font-size: 0.6em;
    font-weight: 600;
    color: #dc3545;
}

.sd-plan-features {
    margin-bottom: 20px;
}

.sd-plan-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sd-plan-features li {
    padding: 8px 0;
    border-bottom: 1px solid #f1f3f4;
    color: #6c757d;
}

.sd-plan-features li:last-child {
    border-bottom: none;
}

.sd-plan-action {
    text-align: center;
}

.sd-plan-current-badge {
    background: #28a745;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    display: inline-block;
}

/* Modal Styles */
.sd-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.sd-modal-content {
    background: white;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.sd-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sd-modal-header h3 {
    margin: 0;
    color: #495057;
}

.sd-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.sd-modal-close:hover {
    background: #f8f9fa;
    color: #495057;
}

.sd-modal-body {
    padding: 20px;
}

/* Plan Selection Options */
.sd-plan-options {
    display: grid;
    gap: 15px;
    margin-top: 15px;
}

.sd-plan-option {
    position: relative;
}

.sd-plan-option input[type="radio"] {
    display: none;
}

.sd-plan-option label {
    display: block;
    cursor: pointer;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: white;
}

.sd-plan-option input[type="radio"]:checked + label {
    border-color: #007cba;
    background: linear-gradient(135deg, #f8fbff 0%, #e8f4ff 100%);
    box-shadow: 0 4px 15px rgba(0, 124, 186, 0.15);
}

.sd-plan-option.current label {
    border-color: #28a745;
    background: linear-gradient(135deg, #f8fff9 0%, #e8f5e8 100%);
    opacity: 0.7;
    cursor: not-allowed;
}

.sd-plan-option-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sd-plan-option-header h5 {
    margin: 0 0 5px 0;
    color: #495057;
    font-size: 1.1em;
}

.sd-plan-option-price {
    font-size: 1.2em;
    font-weight: bold;
    color: #007cba;
}

.sd-plan-option-description {
    flex: 1;
    margin-left: 15px;
}

.sd-plan-option-description p {
    margin: 0 0 8px 0;
    color: #6c757d;
    font-size: 0.9em;
}

.sd-plan-option-description ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sd-plan-option-description li {
    color: #28a745;
    font-size: 0.85em;
    margin-bottom: 2px;
}

/* PayPal Container */
#sd-paypal-container {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
    text-align: center;
}

#sd-paypal-container h4 {
    margin: 0 0 15px 0;
    color: #495057;
}

#paypal-button-container {
    display: inline-block;
    margin: 0 auto;
}

/* Pricing Table Shortcode */
.sd-pricing-table {
    display: grid;
    gap: 24px;
    margin: 40px 0;
}

.sd-pricing-table.columns-2 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.sd-pricing-table.columns-3 {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.sd-pricing-table.columns-4 {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.sd-pricing-card {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sd-pricing-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
}

.sd-pricing-card.is-highlighted {
    border-color: #007cba;
    box-shadow: 0 18px 48px rgba(0, 124, 186, 0.2);
}

.sd-pricing-card__header {
    padding: 24px 24px 12px;
    text-align: center;
}

.sd-pricing-card__title {
    margin: 0;
    font-size: 1.6em;
    color: #0f172a;
}

.sd-pricing-card__subtitle {
    margin: 12px 0 0;
    color: #6c757d;
    font-size: 0.95em;
}

.sd-pricing-card__price {
    padding: 12px 24px 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: linear-gradient(180deg, rgba(0, 124, 186, 0.04), rgba(0, 124, 186, 0.08));
}

.sd-pricing-card__amount {
    font-size: 2em;
    font-weight: 700;
    color: #007cba;
}

.sd-pricing-card__base {
    font-size: 0.9em;
    color: #adb5bd;
    text-decoration: line-through;
}

.sd-pricing-card__badge {
    display: inline-block;
    align-self: center;
    background: #ffc107;
    color: #212529;
    font-size: 0.75em;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
}

.sd-pricing-card__dates {
    font-size: 0.75em;
    color: #495057;
}

.sd-pricing-card__features {
    padding: 20px 28px;
    flex: 1;
}

.sd-pricing-card__features ul {
    margin: 0;
    padding-left: 18px;
    color: #334155;
    line-height: 1.6;
}

.sd-pricing-card__features li {
    margin-bottom: 8px;
}

.sd-pricing-card__footer {
    padding: 20px 24px 28px;
    text-align: center;
}

.sd-pricing-card__button {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 999px;
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
    color: #ffffff;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.3s ease, transform 0.3s ease;
}

.sd-pricing-card__button:hover {
    background: linear-gradient(135deg, #005a87 0%, #007cba 100%);
    transform: translateY(-2px);
}

.sd-pricing-table-empty {
    padding: 20px;
    border: 1px dashed #e9ecef;
    border-radius: 8px;
    text-align: center;
    color: #6c757d;
    background: #f8f9fa;
}

.sd-pricing-countdown {
    margin-top: 32px;
    padding: 28px 24px 32px;
    background: linear-gradient(135deg, #001f3f 0%, #003162 100%);
    border-radius: 18px;
    color: #ffffff;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 18, 40, 0.35);
    position: relative;
    overflow: hidden;
}

.sd-pricing-countdown::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.15), transparent 60%);
    pointer-events: none;
}

.sd-pricing-countdown__title {
    font-size: 1.35em;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 18px;
    font-weight: 700;
}

.sd-pricing-countdown__timer {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.sd-countdown-segment {
    min-width: 110px;
}

.sd-countdown-number {
    font-size: 3.2em;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 18px 12px;
    margin-bottom: 10px;
    box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.25);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sd-countdown-number--pulse {
    animation: sdCountdownPulse 1s ease;
}

.sd-countdown-label {
    font-size: 0.85em;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.8);
}

.sd-pricing-countdown__message {
    margin-top: 16px;
    font-weight: 600;
    letter-spacing: 0.06em;
    opacity: 0;
    transition: opacity 0.4s ease;
    position: relative;
    z-index: 1;
}

.sd-pricing-countdown__message.is-active {
    opacity: 1;
}

.sd-pricing-countdown.is-finished .sd-countdown-number {
    background: rgba(255, 255, 255, 0.05);
    box-shadow: none;
}

@keyframes sdCountdownPulse {
    0% {
        transform: scale(1);
        box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.25);
    }
    50% {
        transform: scale(1.08);
        box-shadow: inset 0 0 30px rgba(255, 255, 255, 0.25);
    }
    100% {
        transform: scale(1);
        box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.25);
    }
}

/* Message Styles */
.sd-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    z-index: 10000;
    max-width: 300px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    animation: slideInRight 0.3s ease;
}

.sd-message-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.sd-message-error {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.sd-message-warning {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #212529;
}

.sd-message-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
}

.sd-message-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.sd-message-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Current Plan Info */
.sd-current-plan-info {
    text-align: center;
    padding: 15px;
    background: linear-gradient(135deg, #e8f4ff 0%, #f8fbff 100%);
    border-radius: 6px;
    border: 2px solid #007cba;
    margin-bottom: 20px;
}

.sd-current-plan-info h4 {
    margin: 0 0 10px 0;
    color: #007cba;
}

.sd-current-plan-info p {
    margin: 0;
    color: #6c757d;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sd-plan-cards {
        grid-template-columns: 1fr;
    }
    
    .sd-plan-option-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .sd-plan-option-description {
        margin-left: 0;
    }
    
    .sd-modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .sd-message {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* Animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading States */
.sd-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Disabled States */
.sd-plan-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.sd-plan-card.disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Plan Comparison */
.sd-plan-comparison {
    margin-top: 30px;
    overflow-x: auto;
}

.sd-plan-comparison-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.sd-plan-comparison-table th,
.sd-plan-comparison-table td {
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
}

.sd-plan-comparison-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.sd-plan-comparison-table td:first-child {
    text-align: left;
    font-weight: 600;
    background: #f8f9fa;
}

.sd-plan-comparison-table .feature-yes {
    color: #28a745;
    font-weight: bold;
}

.sd-plan-comparison-table .feature-no {
    color: #dc3545;
}

.sd-plan-comparison-table .feature-limit {
    color: #007cba;
    font-weight: 600;
}
