/**
 * M2 Lisans - Müşteri Portal CSS
 * WooCommerce My Account entegrasyonu stilleri
 */

/* === Portal Container === */
.m2-portal-wrap {
    padding: 20px 0;
}

.m2-portal-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 30px;
    color: #1e293b;
}

.m2-portal-empty {
    text-align: center;
    padding: 60px 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px dashed #e2e8f0;
}

.m2-portal-empty p {
    color: #64748b;
    margin-bottom: 20px;
}

/* === Buttons === */
.m2-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    background: #e2e8f0;
    color: #475569;
}

.m2-btn:hover {
    background: #cbd5e1;
    color: #334155;
}

.m2-btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.m2-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
    color: white;
}

/* === License Cards Grid === */
.m2-licenses-grid {
    display: grid;
    gap: 24px;
}

.m2-license-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.m2-license-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* License Header */
.m2-license-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.m2-license-product {
    display: flex;
    align-items: center;
    gap: 14px;
}

.m2-product-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
}

.m2-license-product h3 {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

.m2-plan {
    display: inline-block;
    padding: 2px 10px;
    background: #f1f5f9;
    border-radius: 20px;
    font-size: 12px;
    color: #64748b;
}

/* Status Badges */
.m2-status {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.m2-status-active {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
}

.m2-status-inactive {
    background: #f1f5f9;
    color: #64748b;
}

.m2-status-expired {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
}

.m2-status-suspended,
.m2-status-revoked {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
}

.m2-status-paused {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
}

/* Ticket statuses */
.m2-status-open {
    background: #dbeafe;
    color: #1e40af;
}

.m2-status-in_progress {
    background: #fef3c7;
    color: #92400e;
}

.m2-status-waiting {
    background: #f3e8ff;
    color: #7c3aed;
}

.m2-status-resolved {
    background: #dcfce7;
    color: #166534;
}

.m2-status-closed {
    background: #f1f5f9;
    color: #64748b;
}

/* License Key */
.m2-license-key {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
}

.m2-license-key code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    font-weight: 600;
    color: #6366f1;
    flex: 1;
    word-break: break-all;
    background: transparent;
    padding: 0;
}

.m2-copy-btn {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.m2-copy-btn:hover {
    background: #6366f1;
    border-color: #6366f1;
}

/* License Meta */
.m2-license-meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.m2-meta-item {
    text-align: center;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
}

.m2-meta-label {
    display: block;
    font-size: 12px;
    color: #64748b;
    margin-bottom: 4px;
}

.m2-meta-value {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
}

/* Activations */
.m2-activations {
    border-top: 1px solid #e2e8f0;
    padding-top: 20px;
}

.m2-activations h4 {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin: 0 0 12px 0;
}

.m2-activations ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.m2-activations li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 8px;
}

.m2-domain {
    font-family: monospace;
    font-size: 13px;
    color: #475569;
}

.m2-deactivate-btn {
    background: transparent;
    border: none;
    color: #ef4444;
    font-size: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: color 0.2s;
}

.m2-deactivate-btn:hover {
    color: #dc2626;
}

/* License Actions */
.m2-license-actions {
    border-top: 1px solid #e2e8f0;
    padding-top: 20px;
    text-align: center;
}

/* === Support Form === */
.m2-support-form-wrap {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

.m2-support-form-wrap h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 24px 0;
    color: #1e293b;
}

.m2-form-group {
    margin-bottom: 20px;
}

.m2-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
}

.m2-form-group input,
.m2-form-group select,
.m2-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.m2-form-group input:focus,
.m2-form-group select:focus,
.m2-form-group textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* === Portal Table === */
.m2-portal-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.m2-portal-table th {
    background: #f8fafc;
    padding: 14px 18px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
}

.m2-portal-table td {
    padding: 14px 18px;
    border-bottom: 1px solid #f1f5f9;
    color: #475569;
}

.m2-portal-table tr:last-child td {
    border-bottom: none;
}

.m2-portal-table code {
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #6366f1;
}

/* === Referral === */
.m2-referral-info {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    padding: 24px 30px;
    border-radius: 16px;
    margin-bottom: 30px;
    text-align: center;
}

.m2-referral-info p {
    margin: 0;
    font-size: 16px;
}

.m2-referral-code-box {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

.m2-referral-code-box label {
    display: block;
    font-size: 14px;
    color: #64748b;
    margin-bottom: 12px;
}

.m2-referral-code {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 16px 24px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.m2-referral-code code {
    font-size: 24px;
    font-weight: 700;
    color: #6366f1;
    letter-spacing: 2px;
    background: transparent;
}

.m2-referral-link {
    font-size: 13px;
    color: #64748b;
}

.m2-referral-link code {
    font-size: 12px;
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 4px;
}

/* Referral Stats */
.m2-referral-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.m2-stat-card {
    background: white;
    border-radius: 16px;
    padding: 30px 20px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

.m2-stat-value {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: #6366f1;
    margin-bottom: 8px;
}

.m2-stat-label {
    font-size: 14px;
    color: #64748b;
}

/* === Tickets List === */
.m2-tickets-list h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 20px 0;
    color: #1e293b;
}

/* === Responsive === */
@media (max-width: 768px) {
    .m2-license-header {
        flex-direction: column;
        gap: 14px;
    }
    
    .m2-license-meta {
        grid-template-columns: 1fr;
    }
    
    .m2-referral-stats {
        grid-template-columns: 1fr;
    }
    
    .m2-stat-card {
        padding: 20px;
    }
    
    .m2-stat-value {
        font-size: 24px;
    }
    
    .m2-portal-table {
        font-size: 13px;
    }
    
    .m2-portal-table th,
    .m2-portal-table td {
        padding: 10px 12px;
    }
}

/* === Dark Mode Support === */
@media (prefers-color-scheme: dark) {
    .woocommerce-account .m2-portal-wrap {
        color: #e2e8f0;
    }
    
    .woocommerce-account .m2-license-card,
    .woocommerce-account .m2-support-form-wrap,
    .woocommerce-account .m2-referral-code-box,
    .woocommerce-account .m2-stat-card {
        background: #1e293b;
        border-color: #334155;
    }
    
    .woocommerce-account .m2-portal-title,
    .woocommerce-account .m2-license-product h3 {
        color: #f1f5f9;
    }
    
    .woocommerce-account .m2-form-group input,
    .woocommerce-account .m2-form-group select,
    .woocommerce-account .m2-form-group textarea {
        background: #0f172a;
        border-color: #334155;
        color: #e2e8f0;
    }
}
