.plans-container {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 20px;
padding: 20px 0;
max-width: 1400px;
margin: 0 auto;
}

.plan-card {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border-radius: 20px;
padding: 2rem;
color: white;
position: relative;
overflow: hidden;
transition: all 0.3s ease;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.plan-card:hover {
transform: translateY(-10px);
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.plan-card.featured {
background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
transform: scale(1.05);
border: 3px solid #ffd700;
}

.plan-card.free {
background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.plan-card.premium {
background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.plan-header {
text-align: center;
margin-bottom: 2rem;
}

.plan-name {
font-size: 2rem;
font-weight: bold;
margin-bottom: 0.5rem;
text-transform: uppercase;
letter-spacing: 1px;
}

.plan-price {
font-size: 3rem;
font-weight: 300;
margin-bottom: 0.5rem;
}

.plan-price .currency {
font-size: 1.5rem;
vertical-align: top;
}

.plan-period {
font-size: 1rem;
opacity: 0.8;
}

.features-list {
list-style: none;
padding: 0;
margin: 2rem 0;
}

.features-list li {
padding: 0.8rem 0;
border-bottom: 1px solid rgba(255, 255, 255, 0.2);
position: relative;
padding-left: 2rem;
}

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

.features-list li:before {
content: "✓";
position: absolute;
left: 0;
top: 0.8rem;
width: 20px;
height: 20px;
background: rgba(255, 255, 255, 0.2);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-weight: bold;
font-size: 0.8rem;
}

.plan-button {
width: 100%;
padding: 1rem 2rem;
background: rgba(255, 255, 255, 0.2);
border: 2px solid rgba(255, 255, 255, 0.3);
border-radius: 50px;
color: white;
font-weight: bold;
font-size: 1.1rem;
cursor: pointer;
transition: all 0.3s ease;
text-decoration: none;
display: inline-block;
text-align: center;
backdrop-filter: blur(10px);
}

.plan-button:hover {
background: rgba(255, 255, 255, 0.3);
border-color: rgba(255, 255, 255, 0.5);
color: white;
text-decoration: none;
transform: translateY(-2px);
}

.featured-badge {
position: absolute;
top: -10px;
right: -10px;
background: #ffd700;
color: #333;
padding: 0.5rem 1rem;
border-radius: 20px;
font-weight: bold;
font-size: 0.8rem;
transform: rotate(15deg);
box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
}

.page-headers {
text-align: center;
padding: 3rem 2rem;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
margin-bottom: 2rem;
}

.page-title {
font-size: 3rem;
font-weight: bold;
margin-bottom: 1rem;
}

.page-subtitle {
font-size: 1.2rem;
opacity: 0.9;
max-width: 600px;
margin: 0 auto;
}

.no-plans {
text-align: center;
padding: 4rem 2rem;
color: #666;
}

.no-plans i {
font-size: 4rem;
margin-bottom: 1rem;
color: #ddd;
}

.view-more-btn {
background: none;
border: none;
color: #007bff;
cursor: pointer;
font-size: 14px;
padding: 5px 0;
text-decoration: none;
display: flex;
align-items: center;
gap: 5px;
}

.view-more-btn:hover {
text-decoration: underline;
color: #0056b3;
}

.view-more-item {
list-style: none;
margin-top: 10px;
}

.modal-body {
padding: 20px;
max-height: 400px;
overflow-y: auto;
}

.plan-button.processing {
background-color: #6c757d !important;
border-color: #6c757d !important;
cursor: not-allowed;
}

.plan-button.success {
background-color: #28a745 !important;
border-color: #28a745 !important;
}

.plan-button.error {
background-color: #dc3545 !important;
border-color: #dc3545 !important;
animation: shake 0.5s ease-in-out;
}

.plan-button.disabled-temp {
opacity: 0.6;
cursor: not-allowed;
}

.plan-card.current-user-plan {
border: 2px solid #28a745;
position: relative;
}

.current-plan-badge {
position: absolute;
top: 0px;
right: 10px;
background: #28a745;
color: white;
padding: 5px 12px;
border-radius: 15px;
font-size: 12px;
font-weight: bold;
z-index: 2;
}

.current-plan-badge.expired {
background: #dc3545;
}

.plan-status {
margin-top: 10px;
padding: 8px 12px;
border-radius: 5px;
font-size: 13px;
text-align: center;
}

.plan-status.active {
background: #d4edda;
color: #155724;
border: 1px solid #c3e6cb;
}

.plan-status.expired {
background: #f8d7da;
color: #721c24;
border: 1px solid #f5c6cb;
}

.plan-button.current-plan-active {
background: #17a2b8;
border-color: #17a2b8;
}

.plan-button.current-plan-expired {
background: #dc3545;
border-color: #dc3545;
}

.plan-button.plan-switch {
background: #fd7e14;
border-color: #fd7e14;
}

.plan-button.plan-buy {
background: #007bff;
border-color: #007bff;
}

.plan-button:hover {
opacity: 0.9;
transform: translateY(-2px);
}

/* Cancel Subscription Button Styling */
.cancel-subscription-btn {
width: 100%;
padding: 12px 20px;
margin-top: 12px;
background: linear-gradient(135deg, #dc3545, #c82333);
color: white;
border: none;
border-radius: 8px;
font-weight: 600;
font-size: 14px;
cursor: pointer;
transition: all 0.3s ease;
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
}

.cancel-subscription-btn:hover {
background: linear-gradient(135deg, #c82333, #a71e2a);
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.cancel-subscription-btn:active {
transform: translateY(0);
box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
}

.cancel-subscription-btn:disabled {
background: #6c757d;
cursor: not-allowed;
transform: none;
box-shadow: none;
}

.cancel-info {
text-align: center;
margin-top: 8px;
color: #6c757d;
font-size: 12px;
}

.cancel-info i {
color: #17a2b8;
margin-right: 4px;
}

.current-plan {
background: #f8f9fa;
border-radius: 10px;
padding: 20px;
margin-bottom: 25px;
border-left: 4px solid #007bff;
}

.current-plan h3 {
color: #007bff;
margin-bottom: 10px;
}

.plan-details {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 15px;
margin-top: 15px;
}

.detail-item {
background: white;
padding: 15px;
border-radius: 8px;
border: 1px solid #e9ecef;
}

.detail-label {
font-size: 12px;
color: #6c757d;
text-transform: uppercase;
letter-spacing: 0.5px;
margin-bottom: 5px;
}

.detail-value {
font-weight: 600;
color: #495057;
}

.cancellation-preview {
background: #fff3cd;
border: 1px solid #ffeaa7;
border-radius: 10px;
padding: 20px;
margin-bottom: 25px;
}

.cancellation-preview h3 {
color: #856404;
margin-bottom: 15px;
display: flex;
align-items: center;
gap: 10px;
}

.charge-breakdown {
background: white;
border-radius: 8px;
padding: 15px;
margin-top: 15px;
}

.breakdown-row {
display: flex;
justify-content: space-between;
padding: 8px 0;
border-bottom: 1px solid #e9ecef;
}

.breakdown-row:last-child {
border-bottom: none;
font-weight: 600;
font-size: 16px;
color: #dc3545;
}

.reason-section {
margin-bottom: 25px;
}

.reason-section label {
display: block;
margin-bottom: 10px;
font-weight: 600;
color: #495057;
}

.reason-textarea {
width: 100%;
padding: 15px;
border: 2px solid #e9ecef;
border-radius: 8px;
font-family: inherit;
resize: vertical;
min-height: 100px;
transition: border-color 0.3s ease;
}

.reason-textarea:focus {
outline: none;
border-color: #007bff;
}

.char-counter {
text-align: right;
font-size: 12px;
color: #6c757d;
margin-top: 5px;
}

.confirmation-section {
background: #f8f9fa;
border-radius: 10px;
padding: 20px;
margin-bottom: 25px;
}

.checkbox-container {
display: flex;
align-items: flex-start;
gap: 10px;
}

.checkbox-container input[type="checkbox"] {
margin-top: 2px;
}

.checkbox-container label {
font-size: 14px;
line-height: 1.5;
margin-bottom: 0;
}

.action-buttons {
display: flex;
gap: 15px;
justify-content: center;
}

/* Duration Selection Modal Styles */
.duration-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 65px;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px)
}

.duration-modal-content {
        background: white;
    margin: 2% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    animation: slideIn 0.3s ease;
    display: flex;
    flex-direction: column;
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.duration-modal-header {
    padding: 25px 30px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.duration-modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 24px;
    font-weight: 600;
}

.close-duration-modal {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    padding: 5px;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-duration-modal:hover {
    background: #f8f9fa;
    color: #333;
}

.duration-modal-body {
    padding: 20px 30px;
    flex: 1;
    overflow-y: auto;
    max-height: calc(90vh - 150px);
}

.duration-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.duration-modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #eee;
    background: #f8f9fa;
    border-radius: 0 0 20px 20px;
    flex-shrink: 0;
}

.duration-option {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 15px;
    padding: 18px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.duration-option:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.duration-option.selected {
    background: linear-gradient(135deg, #eea667 0%, #bff007 100%);
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
}

.duration-option .duration-label {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
    line-height: 1.2;
}

.duration-option .duration-price {
    font-size: 14px;
    color: #666;
}

.duration-option.selected .duration-price {
    color: rgba(255,255,255,0.9);
    opacity: 0.9;
}

.duration-type-tabs {
    display: flex;
    background: #f8f9fa;
    border-radius: 15px;
    padding: 5px;
    margin-bottom: 25px;
}

.duration-type-tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: #666;
}

.duration-type-tab.active {
    background: white;
    color: #667eea;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.confirm-selection-btn {
    width: 100%;
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 50px;
}

.confirm-selection-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.confirm-selection-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

.confirm-selection-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    background: #6c757d;
}

.pricing-info {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.pricing-info h4 {
    color: #333;
    margin-bottom: 15px;
    font-size: 18px;
}

.pricing-breakdown {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding: 5px 0;
}

.pricing-breakdown.total-amount {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 2px solid #667eea;
    font-weight: 600;
    font-size: 16px;
}

.pricing-breakdown span:first-child {
    color: #666;
}

.pricing-breakdown span:last-child {
    color: #333;
    font-weight: 500;
}

.pricing-breakdown:last-child {
    margin-bottom: 0;
    font-weight: bold;
    padding-top: 10px;
    border-top: 1px solid #dee2e6;
}

.no-plans {
    text-align: center;
    padding: 60px;
    color: #666;
}

.no-plans i {
    font-size: 48px;
    margin-bottom: 20px;
    color: #ccc;
}

@media (max-width: 768px) {
    .duration-options {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .duration-modal-content {
        width: 95%;
        margin: 5% auto;
        max-height: 85vh;
    }

    .duration-modal-header {
        padding: 20px 20px 15px;
    }
    
    .duration-modal-body {
        padding: 15px 20px;
    }
    
    .duration-modal-footer {
        padding: 15px 20px;
    }
    
    .duration-modal-header h3 {
        font-size: 20px;
    }

    .duration-modal-header, .duration-modal-body, .duration-modal-footer {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .partial-month-breakdown .alert .text-muted {
        color: #616161 !important;
        font-size: 14px;
        margin-top: 12px;
    }

    .breakdown-row.total-row span:last-child {
        color: #2e7d32;
    }
    
    .plans-container {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .plan-card.featured {
        transform: none;
    }

    .breakdown-row {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    
    .breakdown-row span:last-child {
        margin-top: 4px;
        font-weight: bold;
    }
    
    .subscription-confirmation .breakdown-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .subscription-confirmation .breakdown-item span:last-child {
        margin-top: 5px;
    }
}

@media (max-width: 480px) {
    .duration-options {
        grid-template-columns: 1fr;
    }
    
    .duration-modal-content {
        width: 98%;
        margin: 2px auto;
        max-height: 95vh;
    }
}

/* Enhanced focus states for accessibility */
.duration-option:focus, .duration-type-tab:focus, .confirm-selection-btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Loading state for confirm button */
.confirm-selection-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

.confirm-selection-btn.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

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

        /* Add these CSS styles to your existing stylesheet */

/* Partial Month Breakdown Styles */
.partial-month-breakdown {
    margin-top: 15px;
}

.partial-month-breakdown .alert {
    margin-bottom: 0;
    border-left: 4px solid #17a2b8;
}

.breakdown-details {
    margin-top: 10px;
}

.breakdown-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid #e9ecef;
}

.breakdown-row:last-child {
    border-bottom: none;
}

.breakdown-row.total-row {
    border-top: 2px solid #28a745;
    margin-top: 10px;
    padding-top: 10px;
    font-weight: bold;
}

/* Enhanced duration option styles */
.duration-option {
    position: relative;
    transition: all 0.3s ease;
}

.duration-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.duration-option.selected {
    border-color: #007bff;
    background-color: #f8f9fa;
}

.price-breakdown {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e9ecef;
}

.price-breakdown small {
    font-size: 0.75rem;
    line-height: 1.2;
}

/* Proration Preview Styles */
.proration-preview {
    margin-bottom: 20px;
}

.proration-preview .alert {
    margin-bottom: 0;
    border-radius: 8px;
}

/* Confirmation dialog styles */
.subscription-confirmation .pricing-breakdown {
    background-color: #f8f9fa;
    border-radius: 6px;
    padding: 12px;
    margin-top: 10px;
}

.subscription-confirmation .breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid #dee2e6;
}

.subscription-confirmation .breakdown-item:last-child {
    border-bottom: none;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 2px solid #007bff;
    font-weight: bold;
}

.partial-month-confirmation {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border-radius: 8px;
    padding: 15px;
}

.partial-month-confirmation .alert {
    margin-bottom: 0;
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(23, 162, 184, 0.3);
}

/* Animation for breakdown appearance */
.partial-month-breakdown {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced alert styling for partial month info */
.alert-info.partial-month-alert {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    border-color: #17a2b8;
    color: #0c5460;
}

.alert-info.partial-month-alert h6 {
    color: #0c5460;
    margin-bottom: 12px;
}

.alert-info.partial-month-alert .fas {
    color: #17a2b8;
    margin-right: 8px;
}

/* Pricing info enhancements */
.pricing-info {
    position: relative;
}

.pricing-info .partial-month-breakdown {
    border-top: 1px solid #dee2e6;
    margin-top: 15px;
    padding-top: 15px;
}

/* Duration option price breakdown styling */
.duration-option .price-breakdown {
    background-color: rgba(248, 249, 250, 0.8);
    border-radius: 4px;
    padding: 6px 8px;
    margin: 8px -8px -8px -8px;
}

.duration-option.selected .price-breakdown {
    background-color: rgba(0, 123, 255, 0.1);
    border-top: 1px solid rgba(255,255,255,0.3);
}

/* Calendar icon styling */
.fa-calendar-day,
.fa-calendar-alt {
    color: #17a2b8 !important;
}

/* Success message enhancements for partial month */
.success-message .partial-month-note {
    background-color: #e8f5e8;
    border-left: 4px solid #28a745;
    padding: 10px 15px;
    margin-top: 15px;
    border-radius: 0 4px 4px 0;
    font-size: 0.9rem;
    color: #155724;
}

.success-message .partial-month-note .fas {
    color: #28a745;
    margin-right: 6px;
}