/**
 * CSS för abonnemangs-shortcode - Apple-inspirerad design
 */

.smc-abb-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #fff;
    color: #1d1d1f;
    min-height: 100vh;
}

/* Header */
.smc-abb-header {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.smc-abb-header h2 {
    margin: 0 0 30px 0;
    color: #1d1d1f;
    font-size: 32px;
    font-weight: 600;
    text-align: center;
    position: relative;
    font-family: 'CustomHeadingFont', sans-serif;
}

.smc-abb-search {
    margin-bottom: 30px;
    text-align: center;
}

.smc-abb-search input {
    width: 100%;
    max-width: 500px;
    padding: 16px 24px;
    background: #f6f6f6;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    color: #1d1d1f;
    text-align: center;
    transition: all 0.3s ease;
    font-weight: 400;
}

.smc-abb-search input::placeholder {
    color: #86868b;
}

.smc-abb-search input:focus {
    outline: none;
    background: #e8e8ed;
    transform: scale(1.02);
}

/* Statistik */
.smc-abb-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.smc-stat-item {
    background: #f6f6f6;
    border-radius: 12px;
    padding: 24px 20px;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
}

.smc-stat-item:hover {
    background: #e8e8ed;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.smc-stat-label {
    display: block;
    font-size: 12px;
    color: #86868b;
    margin-bottom: 8px;
    font-weight: 500;
}

.smc-stat-value {
    display: block;
    font-size: 32px;
    font-weight: 600;
    color: #1d1d1f;
}

.smc-stat-value.smc-active {
    color: #30d158;
}

.smc-stat-value.smc-paused {
    color: #ff9f0a;
}

.smc-stat-value.smc-cancelled {
    color: #ff453a;
}

.smc-stat-value.smc-pending-cancel {
    color: #ff9500;
}

/* Tabell */
.smc-abb-table-container {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.smc-abb-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.smc-abb-table th {
    background: #f6f6f6;
    color: #1d1d1f;
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    border: none;
    font-family: 'CustomHeadingFont', sans-serif;
}

.smc-abb-table th:first-child {
    width: 120px;
}

.smc-abb-table th:nth-child(2) {
    width: 180px;
}

.smc-abb-table th:nth-child(3) {
    width: 200px;
}

.smc-abb-table th:nth-child(4) {
    width: 100px;
}

.smc-abb-table th:nth-child(5) {
    width: 200px;
}

.smc-abb-table th:nth-child(6) {
    width: 160px;
}

.smc-abb-table th:nth-child(7) {
    width: 120px;
}

.smc-abb-table td {
    padding: 16px 20px;
    border: none;
    vertical-align: middle;
    background: #fff;
    transition: all 0.3s ease;
    color: #1d1d1f;
    font-size: 13px;
}

.smc-abb-row:nth-child(even) td {
    background: #f3f3f3;
}

.smc-abb-row:hover td {
    background: #e8e8ed;
}

.smc-customer-name {
    font-weight: 600;
    color: #1d1d1f;
    font-family: 'CustomHeadingFont', sans-serif;
    font-size: 15px;
}

/* Status badges */
.smc-status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    border: none;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.smc-status-active {
    background: rgba(48, 209, 88, 0.15);
    color: #30d158;
}

.smc-status-on-hold {
    background: rgba(255, 159, 10, 0.15);
    color: #ff9f0a;
}

.smc-status-cancelled,
.smc-status-expired {
    background: rgba(255, 69, 58, 0.15);
    color: #ff453a;
}

.smc-status-pending-cancel {
    background: rgba(255, 149, 0, 0.15);
    color: #ff9500;
}

.smc-end-date {
    margin-top: 6px;
}

.smc-end-date small {
    color: #ff9500;
    font-size: 10px;
    font-weight: 500;
    background: rgba(255, 149, 0, 0.1);
    padding: 2px 6px;
    border-radius: 8px;
}

/* Besökstracker */
.smc-visit-tracker {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.smc-visit-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    background: #f6f6f6;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: none;
}

.smc-visit-checkbox:hover {
    background: #e8e8ed;
    transform: scale(1.02);
}

.smc-visit-input {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #30d158;
}

.smc-visit-label {
    font-size: 11px;
    color: #86868b;
    font-weight: 500;
}

.smc-visit-count {
    font-size: 12px;
    color: #30d158;
    text-align: center;
    margin-top: 6px;
    font-weight: 600;
    background: rgba(48, 209, 88, 0.1);
    padding: 2px 8px;
    border-radius: 8px;
}

.smc-visit-checkbox.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.smc-visit-checkbox.disabled:hover {
    background: #f6f6f6;
    transform: none;
}

.smc-visit-checkbox.disabled .smc-visit-input {
    cursor: not-allowed;
}

/* Knappar */
.smc-btn {
    padding: 8px 16px;
    background: #1d1d1f;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    color: #fff;
}

.smc-btn-details {
    background: #1d1d1f;
    color: #fff;
}

.smc-btn-details:hover {
    background: #000;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Modal */
.smc-abb-modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(20px);
}

.smc-abb-modal-content {
    background: #fff;
    margin: 3% auto;
    padding: 0;
    border-radius: 16px;
    width: 95%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: modalSlideIn 0.4s ease;
    position: relative;
    border: none;
}

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

.smc-abb-close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 18px;
    cursor: pointer;
    color: #86868b;
    z-index: 1001;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f6f6f6;
    border-radius: 50%;
    transition: all 0.3s ease;
    border: none;
}

.smc-abb-close:hover {
    color: #1d1d1f;
    background: #e8e8ed;
}

/* Abonnemangsdetaljer */
.smc-subscription-details {
    padding: 40px;
    color: #1d1d1f;
}

.smc-subscription-details h3 {
    margin: 0 0 40px 0;
    color: #1d1d1f;
    font-size: 28px;
    font-weight: 600;
    text-align: center;
    padding-bottom: 20px;
    position: relative;
    font-family: 'CustomHeadingFont', sans-serif;
}

.smc-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 40px;
}

.smc-details-section {
    margin-bottom: 24px;
    background: #f6f6f6;
    border-radius: 12px;
    padding: 24px;
    border: none;
}

.smc-details-section h4 {
    margin: 0 0 16px 0;
    color: #1d1d1f;
    font-size: 16px;
    font-weight: 600;
    font-family: 'CustomHeadingFont', sans-serif;
}

.smc-details-section p {
    margin: 8px 0;
    color: #86868b;
    font-size: 14px;
    line-height: 1.5;
}

.smc-details-section p strong {
    color: #1d1d1f;
    font-weight: 600;
}

/* Besökshistorik */
.smc-visit-history {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.smc-visit-month {
    background: #fff;
    border: 1px solid #e8e8ed;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.smc-visit-month:hover {
    background: #f6f6f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    border-color: #d1d1d6;
}

.smc-visit-month h5 {
    margin: 0 0 16px 0;
    color: #1d1d1f;
    font-size: 15px;
    font-weight: 600;
    font-family: 'CustomHeadingFont', sans-serif;
    padding-bottom: 8px;
    border-bottom: 1px solid #e8e8ed;
}

.smc-visit-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.smc-visit-item {
    padding: 10px 0;
    font-size: 13px;
    color: #86868b;
    line-height: 1.4;
    border-bottom: 1px solid #f6f6f6;
}

.smc-visit-item:last-child {
    border-bottom: none;
}

.smc-visit-item strong {
    color: #30d158;
    font-weight: 600;
}

.smc-visit-item em {
    color: #86868b;
    font-style: normal;
    font-size: 11px;
}

.smc-no-visits {
    color: #86868b;
    font-style: italic;
    font-size: 13px;
    margin: 0;
    text-align: center;
    padding: 20px 0;
    background: #f6f6f6;
    border-radius: 8px;
}

/* Betalningshistorik */
.smc-payment-history {
    max-height: 400px;
    overflow-y: auto;
    background: #fff;
    border-radius: 12px;
}

.smc-payment-item {
    background: #f6f6f6;
    border-radius: 8px;
    margin-bottom: 8px;
    padding: 16px;
    transition: all 0.3s ease;
    border: none;
}

.smc-payment-item:hover {
    background: #e8e8ed;
    transform: translateY(-1px);
}

.smc-payment-item:last-child {
    margin-bottom: 0;
}

.smc-payment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.smc-payment-date {
    font-weight: 600;
    color: #1d1d1f;
    font-size: 13px;
}

.smc-payment-amount {
    font-weight: 600;
    color: #30d158;
    font-size: 14px;
}

.smc-payment-details {
    color: #86868b;
    font-size: 11px;
}

/* Responsiv design */
@media (max-width: 768px) {
    .smc-abb-container {
        padding: 20px 10px;
    }

    .smc-abb-header {
        padding: 30px 20px;
    }

    .smc-abb-header h2 {
        font-size: 24px;
        letter-spacing: 2px;
    }

    .smc-abb-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .smc-abb-table-container {
        overflow-x: auto;
    }

    .smc-abb-table {
        min-width: 900px;
    }

    .smc-details-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .smc-visit-history {
        grid-template-columns: 1fr;
    }

    .smc-abb-modal-content {
        width: 98%;
        margin: 1% auto;
        max-height: 95vh;
    }

    .smc-subscription-details {
        padding: 25px 20px;
    }
}

/* Error meddelanden */
.smc-error {
    background: rgba(255, 69, 58, 0.1);
    color: #ff453a;
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    text-align: center;
    font-weight: 600;
    border: none;
}

/* Scrollbar styling */
.smc-payment-history::-webkit-scrollbar,
.smc-abb-modal-content::-webkit-scrollbar {
    width: 6px;
}

.smc-payment-history::-webkit-scrollbar-track,
.smc-abb-modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.smc-payment-history::-webkit-scrollbar-thumb,
.smc-abb-modal-content::-webkit-scrollbar-thumb {
    background: #d1d1d6;
    border-radius: 3px;
}

.smc-payment-history::-webkit-scrollbar-thumb:hover,
.smc-abb-modal-content::-webkit-scrollbar-thumb:hover {
    background: #a1a1a6;
}

/* Responsiv design för Apple-känsla */
@media (max-width: 768px) {
    .smc-abb-container {
        padding: 20px 16px;
    }

    .smc-abb-header {
        padding: 24px;
        border-radius: 12px;
    }

    .smc-abb-header h2 {
        font-size: 24px;
    }

    .smc-abb-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .smc-abb-table-container {
        overflow-x: auto;
        border-radius: 12px;
    }

    .smc-abb-table {
        min-width: 800px;
    }

    .smc-details-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .smc-visit-history {
        grid-template-columns: 1fr;
    }

    .smc-abb-modal-content {
        width: 95%;
        margin: 5% auto;
        border-radius: 12px;
    }

    .smc-subscription-details {
        padding: 24px;
    }
}
