/**
 * WooCommerce License Tab - Customer Portal Styles
 * 
 * @package License Manager
 * @version 1.0.0
 * @author anjarsaputra
 * @since 2025-10-04
 */

/* ========================================
   WRAPPER & CONTAINER
======================================== */

.alm-licenses-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

/* ========================================
   HEADER
======================================== */

.alm-licenses-header {
    margin-bottom: 30px;
}

.alm-licenses-header h2 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 600;
    color: #333;
}

.alm-licenses-description {
    color: #666;
    font-size: 15px;
    margin: 0;
}

/* ========================================
   LICENSES COUNT
======================================== */

.alm-licenses-count {
    background: #f7f7f7;
    border-left: 4px solid #2c3e50;
    padding: 12px 20px;
    margin-bottom: 25px;
    font-size: 14px;
    color: #555;
}

.alm-licenses-count strong {
    color: #2c3e50;
    font-size: 18px;
    font-weight: 700;
}

/* ========================================
   NO LICENSES (EMPTY STATE)
======================================== */

.alm-no-licenses {
    text-align: center;
    padding: 60px 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 2px dashed #ddd;
}

.alm-no-licenses-icon {
    color: #ccc;
    margin-bottom: 20px;
}

.alm-no-licenses-icon svg {
    width: 64px;
    height: 64px;
}

.alm-no-licenses h3 {
    margin: 0 0 10px 0;
    font-size: 22px;
    color: #555;
}

.alm-no-licenses p {
    color: #777;
    font-size: 15px;
    margin-bottom: 20px;
}

.alm-no-licenses .alm-notice {
    background: #fff3cd;
    border: 1px solid #ffc107;
    padding: 15px;
    border-radius: 5px;
    margin: 20px auto;
    max-width: 500px;
    font-size: 14px;
}

.alm-btn-primary {
    background: #2c3e50 !important;
    color: #fff !important;
    border: none !important;
    padding: 12px 30px !important;
    border-radius: 5px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    display: inline-block !important;
    transition: all 0.3s ease !important;
}

.alm-btn-primary:hover {
    background: #34495e !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* ========================================
   LICENSES GRID
======================================== */

.alm-licenses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

@media (max-width: 768px) {
    .alm-licenses-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   LICENSE CARD
======================================== */

.alm-license-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.alm-license-card:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
    transform: translateY(-3px);
    border-color: #2c3e50;
}

/* Status variants */
.alm-license-card.alm-status-active {
    border-left: 4px solid #28a745;
}

.alm-license-card.alm-status-expired {
    border-left: 4px solid #dc3545;
    background: #fff5f5;
}

.alm-license-card.alm-status-suspended {
    border-left: 4px solid #ffc107;
    background: #fffef5;
}

/* ========================================
   CARD HEADER
======================================== */

.alm-license-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.alm-license-product h3 {
    margin: 0 0 5px 0;
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
}

.alm-purchase-date {
    font-size: 13px;
    color: #999;
}

/* ========================================
   STATUS BADGE
======================================== */

.alm-status-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.alm-status-badge.alm-status-active {
    background: #d4edda;
    color: #155724;
}

.alm-status-badge.alm-status-expired {
    background: #f8d7da;
    color: #721c24;
}

.alm-status-badge.alm-status-suspended {
    background: #fff3cd;
    color: #856404;
}

/* ========================================
   LICENSE KEY
======================================== */

.alm-license-key-wrapper {
    margin-bottom: 20px;
}

.alm-license-key-wrapper label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
}

.alm-license-key-group {
    display: flex;
    gap: 10px;
}

.alm-license-key-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: 600;
    background: #f9f9f9;
    color: #2c3e50;
    letter-spacing: 1px;
}

.alm-license-key-input:focus {
    outline: none;
    border-color: #2c3e50;
    background: #fff;
}

.alm-copy-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: #2c3e50;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.alm-copy-btn:hover {
    background: #34495e;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.alm-copy-btn:active {
    transform: translateY(0);
}

.alm-copy-btn.copied {
    background: #28a745;
}

.alm-copy-btn svg {
    width: 16px;
    height: 16px;
}

/* ========================================
   LICENSE DETAILS
======================================== */

.alm-license-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 5px;
}

.alm-detail-item {
    display: flex;
    flex-direction: column;
}

.alm-detail-item.alm-detail-full {
    grid-column: 1 / -1;
}

.alm-detail-label {
    font-size: 12px;
    font-weight: 600;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.alm-detail-value {
    font-size: 15px;
    font-weight: 600;
    color: #2c3e50;
}

.alm-detail-value.alm-expired {
    color: #dc3545;
}

.alm-limit-reached {
    color: #dc3545;
    font-size: 12px;
    font-weight: 500;
}

.alm-expiring-soon {
    color: #ff6b6b;
    font-size: 13px;
    font-weight: 600;
}

.alm-order-link {
    color: #2c3e50;
    text-decoration: none;
    font-weight: 700;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s;
}

.alm-order-link:hover {
    border-bottom-color: #2c3e50;
}

.alm-order-meta {
    display: block;
    font-size: 12px;
    color: #999;
    font-weight: 400;
    margin-top: 3px;
}

/* ========================================
   ACTIVE SITES
======================================== */

.alm-active-sites {
    margin-bottom: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.alm-active-sites h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.alm-sites-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.alm-site-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    margin-bottom: 10px;
    transition: all 0.2s;
}

.alm-site-item:hover {
    background: #fff;
    border-color: #2c3e50;
}

.alm-site-info {
    flex: 1;
}

.alm-site-url {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 3px;
}

.alm-site-date {
    font-size: 12px;
    color: #999;
}

.alm-deactivate-btn {
    padding: 8px 16px;
    background: #fff;
    color: #dc3545;
    border: 1px solid #dc3545;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.alm-deactivate-btn:hover {
    background: #dc3545;
    color: #fff;
}

.alm-deactivate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========================================
   ACTIONS
======================================== */

.alm-license-actions {
    display: flex;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.alm-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.alm-btn svg {
    width: 16px;
    height: 16px;
}

.alm-btn-download {
    background: #2c3e50;
    color: #fff;
    border: none;
}

.alm-btn-download:hover {
    background: #34495e;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.alm-btn-docs {
    background: #fff;
    color: #2c3e50;
    border: 1px solid #2c3e50;
}

.alm-btn-docs:hover {
    background: #2c3e50;
    color: #fff;
}

/* ========================================
   HELP SECTION
======================================== */

.alm-help-section {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    text-align: center;
}

.alm-help-section h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #333;
}

.alm-help-section p {
    color: #666;
    margin-bottom: 20px;
}

/* ========================================
   NOTIFICATIONS
======================================== */

.alm-notification {
    position: fixed;
    top: 80px;
    right: 20px;
    background: #fff;
    border-radius: 8px;
    padding: 15px 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 99999;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    animation: slideInRight 0.3s ease;
    border-left: 4px solid #28a745;
}

.alm-notification.error {
    border-left-color: #dc3545;
}

.alm-notification.success {
    border-left-color: #28a745;
}

.alm-notification.info {
    border-left-color: #17a2b8;
}

.alm-notification-content {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.alm-notification-close {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 20px;
    padding: 0;
    line-height: 1;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* ========================================
   LOADING STATE
======================================== */

.alm-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2c3e50;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   RESPONSIVE
======================================== */

@media (max-width: 768px) {
    .alm-licenses-wrapper {
        padding: 15px;
    }

    .alm-license-card {
        padding: 20px;
    }

    .alm-license-header {
        flex-direction: column;
        gap: 10px;
    }

    .alm-license-key-group {
        flex-direction: column;
    }

    .alm-copy-btn {
        width: 100%;
        justify-content: center;
    }

    .alm-license-details {
        grid-template-columns: 1fr;
    }

    .alm-license-actions {
        flex-direction: column;
    }

    .alm-site-item {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .alm-deactivate-btn {
        width: 100%;
    }
}

/* ========================================
   MODAL STYLES
======================================== */

.alm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.alm-modal.active {
    display: block;
    opacity: 1;
}

.alm-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.alm-modal-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 20px;
    animation: slideInDown 0.4s ease;
}

.alm-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    max-width: 480px;
    width: 100%;
    padding: 40px 30px 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.alm-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    transition: all 0.2s;
}

.alm-modal-close:hover {
    color: #333;
    transform: rotate(90deg);
}

.alm-modal-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scaleIn 0.5s ease;
}

.alm-modal-icon-warning {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    box-shadow: 0 10px 30px rgba(238, 90, 82, 0.3);
}

.alm-modal-icon svg {
    width: 48px;
    height: 48px;
    stroke: #fff;
}

.alm-modal-title {
    margin: 0 0 15px 0;
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
}

.alm-modal-body {
    margin-bottom: 25px;
}

.alm-modal-body > p {
    color: #666;
    font-size: 15px;
    line-height: 1.6;
    margin: 0 0 15px 0;
}

.alm-site-info-box {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    text-align: left;
}

.alm-site-info-box strong {
    display: block;
    font-size: 12px;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.alm-site-info-box .alm-modal-site-url {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    font-family: 'Courier New', monospace;
    word-break: break-all;
}

.alm-modal-note {
    font-size: 13px !important;
    color: #999 !important;
    font-style: italic;
}

.alm-modal-footer {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.alm-modal-footer .alm-btn {
    flex: 1;
    max-width: 180px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.alm-btn-cancel {
    background: #fff;
    color: #666;
    border: 2px solid #ddd;
}

.alm-btn-cancel:hover {
    background: #f8f9fa;
    border-color: #999;
    color: #333;
}

.alm-btn-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(238, 90, 82, 0.3);
}

.alm-btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(238, 90, 82, 0.4);
}

.alm-btn-danger svg {
    width: 16px;
    height: 16px;
}

/* Prevent body scroll when modal open */
body.alm-modal-open {
    overflow: hidden;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .alm-modal-content {
        padding: 30px 20px 20px;
    }

    .alm-modal-title {
        font-size: 20px;
    }

    .alm-modal-footer {
        flex-direction: column;
    }

    .alm-modal-footer .alm-btn {
        max-width: 100%;
    }
}