/**
 * Subscription Management Page Styles
 */

/* Page Header */
.page-header {
    margin-bottom: 30px;
}

.page-header h2 {
    font-size: 1.8rem;
    color: var(--text-color-dark);
    margin-bottom: 5px;
}

.page-header p {
    color: var(--text-color-light);
    font-size: 1rem;
}

/* Subscription Sections */
.subscription-sections {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.section {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

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

.section-header h3 {
    font-size: 1.2rem;
    color: var(--text-color-dark);
    margin: 0;
}

/* Current Plan Section */
.current-plan-details {
    padding: 20px;
}

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

.plan-badge {
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: 500;
}

.plan-badge.free {
    background-color: #e0e0e0;
    color: #555;
}

.plan-badge.silver {
    background-color: #c0c0c0;
    color: #333;
}

.plan-badge.premium {
    background-color: #4a6cf7;
    color: white;
}

.plan-badge.advanced {
    background-color: #9c27b0;
    color: white;
}

.plan-status {
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 500;
}

.plan-status.active {
    background-color: #e8f5e9;
    color: #4CAF50;
}

.plan-status.expired {
    background-color: #ffebee;
    color: #f44336;
}

.plan-status.pending {
    background-color: #fff8e1;
    color: #FFC107;
}

.plan-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.plan-info-item {
    display: flex;
    flex-direction: column;
}

.info-label {
    font-size: 0.85rem;
    color: var(--text-color-light);
    margin-bottom: 5px;
}

.info-value {
    font-size: 1rem;
    color: var(--text-color-dark);
    font-weight: 500;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #4a6cf7;
}

input:focus + .toggle-slider {
    box-shadow: 0 0 1px #4a6cf7;
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

/* Plan Features */
.plan-features {
    margin-bottom: 30px;
}

.plan-features h4 {
    font-size: 1.1rem;
    color: var(--text-color-dark);
    margin: 0 0 15px 0;
}

.plan-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 10px;
}

.plan-features li {
    display: flex;
    align-items: center;
    color: var(--text-color);
    font-size: 0.95rem;
}

.plan-features li i {
    color: #4CAF50;
    margin-right: 10px;
    min-width: 16px;
    text-align: center;
}

.plan-features li i.fa-times {
    color: #f44336;
}

.plan-actions {
    display: flex;
    gap: 15px;
}

.btn {
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    font-size: 0.95rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-color-dark);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-danger {
    background-color: transparent;
    border: 1px solid #f44336;
    color: #f44336;
}

.btn-danger:hover {
    background-color: #f44336;
    color: white;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary-color);
    padding: 0;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: underline;
}

.btn-link:hover {
    color: var(--primary-color-dark);
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Usage Statistics Section */
.usage-details {
    padding: 20px;
}

.usage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.usage-item {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    border-radius: 8px;
    background-color: #f9f9f9;
}

.usage-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #e3f2fd;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    color: #2196F3;
    font-size: 1.2rem;
}

.usage-info {
    flex: 1;
}

.usage-info h4 {
    font-size: 1rem;
    color: var(--text-color-dark);
    margin: 0 0 10px 0;
}

.usage-stat {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.usage-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color-dark);
}

.usage-limit {
    font-size: 0.85rem;
    color: var(--text-color-light);
}

.progress-bar {
    height: 6px;
    background-color: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background-color: #4a6cf7;
    border-radius: 3px;
}

/* Available Plans Section */
.available-plans {
    padding: 20px;
}

.plan-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.plan-card {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s;
}

.plan-card.active {
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(74, 108, 247, 0.1);
}

.plan-card-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    background-color: #f9f9f9;
}

.plan-card-header .plan-badge {
    margin-bottom: 10px;
    display: inline-block;
}

.plan-price {
    margin-top: 10px;
}

.plan-price h4 {
    font-size: 1.5rem;
    color: var(--text-color-dark);
    margin: 0 0 5px 0;
}

.plan-price p {
    font-size: 0.85rem;
    color: var(--text-color-light);
    margin: 0;
}

.plan-card-features {
    padding: 20px;
}

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

.plan-card-features li {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: var(--text-color);
}

.plan-card-features li:last-child {
    margin-bottom: 0;
}

.plan-card-features li i {
    color: #4CAF50;
    margin-right: 10px;
    min-width: 16px;
    text-align: center;
}

.plan-card-features li i.fa-times {
    color: #f44336;
}

.plan-card-footer {
    padding: 20px;
    border-top: 1px solid #eee;
}

.plan-comparison {
    text-align: center;
    margin-top: 20px;
}

/* Subscription History Section */
.subscription-history {
    padding: 20px;
}

.history-table-container {
    overflow-x: auto;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
}

.history-table th {
    text-align: left;
    padding: 12px 15px;
    background-color: #f9f9f9;
    color: var(--text-color-dark);
    font-weight: 500;
    border-bottom: 1px solid #eee;
}

.history-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    color: var(--text-color);
}

.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.active {
    background-color: #e8f5e9;
    color: #4CAF50;
}

.status-badge.expired {
    background-color: #f5f5f5;
    color: #757575;
}

.status-badge.cancelled {
    background-color: #ffebee;
    color: #f44336;
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background-color: white;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-content.modal-lg {
    max-width: 800px;
}

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

.modal-header h3 {
    font-size: 1.2rem;
    color: var(--text-color-dark);
    margin: 0;
}

.close-modal {
    background-color: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-color-light);
}

.modal-body {
    flex: 1;
    overflow: auto;
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    padding: 15px 20px;
    border-top: 1px solid #eee;
}

/* Plan Comparison Modal */
.comparison-table-container {
    overflow-x: auto;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
}

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

.comparison-table th:first-child,
.comparison-table td:first-child {
    text-align: left;
}

.comparison-table th {
    background-color: #f9f9f9;
    color: var(--text-color-dark);
    font-weight: 500;
}

.comparison-table th .plan-badge {
    margin-bottom: 5px;
}

.comparison-table th .plan-price {
    font-size: 0.9rem;
    color: var(--text-color);
}

.comparison-table td {
    color: var(--text-color);
}

.comparison-table i.fa-check {
    color: #4CAF50;
}

.comparison-table i.fa-times {
    color: #f44336;
}

/* Cancel Subscription Modal */
.cancel-subscription-content {
    text-align: center;
}

.warning-icon {
    font-size: 3rem;
    color: #FFC107;
    margin-bottom: 20px;
}

.cancel-subscription-content h4 {
    font-size: 1.2rem;
    color: var(--text-color-dark);
    margin: 0 0 15px 0;
}

.cancel-subscription-content p {
    color: var(--text-color);
    margin-bottom: 30px;
}

.cancellation-reasons {
    text-align: left;
}

.cancellation-reasons h5 {
    font-size: 1rem;
    color: var(--text-color-dark);
    margin: 0 0 15px 0;
}

.reason-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.reason-option {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.reason-option input {
    margin-right: 10px;
}

.reason-text {
    color: var(--text-color);
}

.other-reason-container {
    margin-top: 15px;
}

.other-reason-container textarea {
    width: 100%;
    height: 100px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    resize: none;
    font-family: inherit;
}

/* Change Plan Modal */
.change-plan-content h4 {
    font-size: 1.1rem;
    color: var(--text-color-dark);
    margin: 0 0 10px 0;
}

.change-plan-content p {
    color: var(--text-color);
    margin-bottom: 20px;
}

.plan-selection {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.plan-option {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    position: relative;
}

.plan-option input {
    margin-right: 15px;
    margin-top: 15px;
}

.plan-option-content {
    flex: 1;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s;
}

.plan-option input:checked + .plan-option-content {
    border-color: var(--primary-color);
    background-color: rgba(74, 108, 247, 0.05);
}

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

.plan-option-features p {
    margin: 0;
    font-size: 0.9rem;
}

.current-plan-marker {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #4CAF50;
    color: white;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 3px;
}

.billing-cycle-selection {
    margin-top: 30px;
}

.cycle-options {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
}

.cycle-option {
    flex: 1;
    min-width: 150px;
    cursor: pointer;
}

.cycle-option input {
    display: none;
}

.cycle-option-content {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s;
}

.cycle-option input:checked + .cycle-option-content {
    border-color: var(--primary-color);
    background-color: rgba(74, 108, 247, 0.05);
}

.cycle-name {
    font-weight: 500;
    color: var(--text-color-dark);
    margin-bottom: 5px;
}

.cycle-price {
    font-size: 0.9rem;
    color: var(--text-color);
    margin-bottom: 5px;
}

.cycle-savings {
    font-size: 0.8rem;
    color: #4CAF50;
    font-weight: 500;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .plan-info-grid {
        grid-template-columns: 1fr;
    }
    
    .plan-features ul {
        grid-template-columns: 1fr;
    }
    
    .plan-actions {
        flex-direction: column;
    }
    
    .usage-grid {
        grid-template-columns: 1fr;
    }
    
    .plan-cards {
        grid-template-columns: 1fr;
    }
    
    .cycle-options {
        flex-direction: column;
    }
    
    .modal-content {
        width: 95%;
    }
}
