/**
 * ScalingWeb License Manager - Frontend Styles
 * Luxury design for My Account license management
 */

:root {
    --swlm-primary: #6366f1;
    --swlm-primary-dark: #4338ca;
    --swlm-primary-light: #818cf8;
    --swlm-secondary: #8b5cf6;
    --swlm-success: #10b981;
    --swlm-warning: #f59e0b;
    --swlm-danger: #ef4444;
    --swlm-bg: #f3f4f6;
    --swlm-bg-dark: #e5e7eb;
    --swlm-text: #1f2937;
    --swlm-text-light: #6b7280;
    --swlm-white: #ffffff;
    --swlm-shadow-light: rgba(255, 255, 255, 0.8);
    --swlm-shadow-dark: rgba(0, 0, 0, 0.1);
    --swlm-glass-bg: rgba(255, 255, 255, 0.7);
    --swlm-glass-border: rgba(255, 255, 255, 0.2);
}

/* My Licenses Container */
.swlm-my-licenses {
    padding: 20px 0;
}

.swlm-my-licenses h2 {
    font-size: 2rem;
    margin-bottom: 30px;
    color: var(--swlm-text);
    position: relative;
    padding-bottom: 15px;
}

.swlm-my-licenses h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(135deg, var(--swlm-primary) 0%, var(--swlm-secondary) 100%);
    border-radius: 2px;
}

/* Licenses Grid */
.swlm-licenses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 30px;
}

/* License Card */
.swlm-license-card {
    background: var(--swlm-glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--swlm-glass-border);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.swlm-license-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, var(--swlm-primary) 0%, var(--swlm-secondary) 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.swlm-license-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px 0 rgba(31, 38, 135, 0.4);
}

.swlm-license-card:hover::before {
    transform: scaleX(1);
}

/* License Card Header */
.swlm-license-card-header {
    padding: 25px 25px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.swlm-license-card-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--swlm-text);
    font-weight: 600;
}

/* License Card Body */
.swlm-license-card-body {
    padding: 25px;
}

/* License Key Wrapper */
.swlm-license-key-wrapper {
    margin-bottom: 20px;
}

.swlm-license-key-wrapper label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--swlm-text-light);
    font-size: 0.875rem;
}

.swlm-license-key {
    display: flex;
    gap: 10px;
}

.swlm-license-key input {
    flex: 1;
    padding: 12px 16px;
    background: var(--swlm-white);
    border: 1px solid var(--swlm-bg-dark);
    border-radius: 10px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.875rem;
    color: var(--swlm-text);
    box-shadow: inset 2px 2px 5px var(--swlm-shadow-dark),
                inset -2px -2px 5px var(--swlm-shadow-light);
}

/* Copy Button */
.swlm-copy-button {
    padding: 12px 16px;
    background: var(--swlm-bg);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
    box-shadow: 4px 4px 10px var(--swlm-shadow-dark),
                -4px -4px 10px var(--swlm-shadow-light);
}

.swlm-copy-button:hover {
    transform: translateY(-2px);
    box-shadow: 6px 6px 15px var(--swlm-shadow-dark),
                -6px -6px 15px var(--swlm-shadow-light);
}

.swlm-copy-button:active {
    transform: translateY(0);
    box-shadow: inset 2px 2px 5px var(--swlm-shadow-dark),
                inset -2px -2px 5px var(--swlm-shadow-light);
}

.swlm-copy-button.copied {
    background: var(--swlm-success);
    color: var(--swlm-white);
}

/* License Info */
.swlm-license-info {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
}

.swlm-info-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.swlm-info-item:last-child {
    border-bottom: none;
}

.swlm-info-item strong {
    color: var(--swlm-text-light);
    font-weight: 600;
    font-size: 0.875rem;
}

.swlm-info-item span {
    color: var(--swlm-text);
    font-weight: 500;
}

.swlm-expired {
    color: var(--swlm-danger);
}

/* Higher specificity for expired dates - replaces !important */
.swlm-license-card .swlm-info-item .swlm-expired,
.swlm-license-details .swlm-expired {
    color: var(--swlm-danger);
}

/* License Actions */
.swlm-license-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.swlm-license-actions .button {
    flex: 1;
    padding: 12px 20px;
    background: var(--swlm-bg);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    box-shadow: 4px 4px 10px var(--swlm-shadow-dark),
                -4px -4px 10px var(--swlm-shadow-light);
}

.swlm-license-actions .button:hover {
    color: var(--swlm-primary);
    transform: translateY(-2px);
    box-shadow: 6px 6px 15px var(--swlm-shadow-dark),
                -6px -6px 15px var(--swlm-shadow-light);
}

/* Status Badge */
.swlm-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.swlm-status-active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--swlm-success);
}

.swlm-status-inactive,
.swlm-status-pending {
    background: rgba(107, 114, 128, 0.1);
    color: var(--swlm-text-light);
}

.swlm-status-expired,
.swlm-status-revoked {
    background: rgba(239, 68, 68, 0.1);
    color: var(--swlm-danger);
}

.swlm-status-suspended {
    background: rgba(245, 158, 11, 0.1);
    color: var(--swlm-warning);
}

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

.swlm-modal-content {
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--swlm-glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--swlm-glass-border);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    padding: 30px;
    animation: modalSlideIn 0.3s ease;
}

/* License Details */
.swlm-license-details {
    color: var(--swlm-text);
}

.swlm-detail-section {
    margin-bottom: 30px;
}

.swlm-detail-section:last-child {
    margin-bottom: 0;
}

.swlm-detail-section h4 {
    margin: 0 0 15px;
    font-size: 1.125rem;
    color: var(--swlm-text);
}

.swlm-details-table {
    width: 100%;
}

.swlm-details-table tr {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.swlm-details-table td {
    padding: 12px 0;
}

.swlm-details-table td:first-child {
    font-weight: 600;
    color: var(--swlm-text-light);
    width: 40%;
}

/* Activations Table */
.swlm-activations-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--swlm-white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.swlm-activations-table thead {
    background: var(--swlm-bg);
}

.swlm-activations-table th,
.swlm-activations-table td {
    padding: 12px 15px;
    text-align: left;
}

.swlm-activations-table tbody tr {
    border-bottom: 1px solid var(--swlm-bg);
}

.swlm-activations-table tbody tr:last-child {
    border-bottom: none;
}

/* Product License Info */
.swlm-product-license-info {
    background: var(--swlm-bg);
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
}

.swlm-product-license-info h4 {
    margin: 0 0 15px;
    font-size: 1.125rem;
    color: var(--swlm-text);
}

.swlm-product-license-info ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.swlm-product-license-info li {
    padding: 8px 0;
    color: var(--swlm-text-light);
    display: flex;
    align-items: center;
}

.swlm-product-license-info li::before {
    content: '✓';
    color: var(--swlm-success);
    font-weight: bold;
    margin-right: 10px;
}

/* Loading State */
.swlm-loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    margin: 0 auto;
}

/* Notification Toast */
.swlm-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    background: var(--swlm-white);
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 10000;
    max-width: 300px;
}

.swlm-notification.show {
    transform: translateX(0);
}

.swlm-notification-success {
    border-left: 4px solid var(--swlm-success);
    color: var(--swlm-success);
}

.swlm-notification-error {
    border-left: 4px solid var(--swlm-danger);
    color: var(--swlm-danger);
}

.swlm-notification-info {
    border-left: 4px solid var(--swlm-primary);
    color: var(--swlm-primary);
}

.swlm-notification-warning {
    border-left: 4px solid var(--swlm-warning);
    color: var(--swlm-warning);
}

/* Custom Confirmation Modal */
.swlm-confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
}

.swlm-confirm-modal.show {
    display: flex;
}

.swlm-confirm-content {
    background: var(--swlm-white);
    border-radius: 16px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.2s ease;
}

.swlm-confirm-message {
    font-size: 1rem;
    color: var(--swlm-text);
    margin-bottom: 20px;
    line-height: 1.5;
}

.swlm-confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.swlm-confirm-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.swlm-confirm-cancel {
    background: var(--swlm-bg);
    color: var(--swlm-text);
}

.swlm-confirm-cancel:hover {
    background: var(--swlm-bg-dark);
}

.swlm-confirm-ok {
    background: var(--swlm-danger);
    color: var(--swlm-white);
}

.swlm-confirm-ok:hover {
    background: #dc2626;
}

/* Responsive */
@media (max-width: 768px) {
    .swlm-licenses-grid {
        grid-template-columns: 1fr;
    }
    
    .swlm-license-card {
        margin-bottom: 20px;
    }
    
    .swlm-license-actions {
        flex-direction: column;
    }
    
    .swlm-modal-content {
        width: 95%;
        padding: 20px;
    }
}