/**
 * Windows Server Manager - Frontend Styles (WooCommerce My Account)
 * Version 2.0.0
 */

/* ==================== My Servers Page ==================== */
.wsm-my-servers h2 {
    margin-bottom: 20px;
}

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

.wsm-server-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    transition: box-shadow 0.2s;
}

.wsm-server-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.wsm-server-card.offline {
    opacity: 0.8;
}

.wsm-server-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.wsm-server-header h3 {
    margin: 0 10px 0 0;
    flex-grow: 1;
    font-size: 18px;
}

.wsm-status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 10px;
    flex-shrink: 0;
}

.wsm-status-indicator.online {
    background: #46b450;
    box-shadow: 0 0 0 3px rgba(70, 180, 80, 0.2);
}

.wsm-status-indicator.offline {
    background: #dc3232;
}

.wsm-status-text {
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 3px;
    font-weight: 600;
}

.wsm-server-card.online .wsm-status-text {
    background: #d4edda;
    color: #155724;
}

.wsm-server-card.offline .wsm-status-text {
    background: #f8d7da;
    color: #721c24;
}

.wsm-server-info p {
    margin: 8px 0;
    font-size: 14px;
    color: #666;
}

.wsm-server-info strong {
    color: #333;
}

.wsm-last-seen {
    margin-top: 15px !important;
    color: #999 !important;
}

.wsm-server-actions {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.wsm-server-actions .button {
    flex: 1;
    min-width: 120px;
    text-align: center;
}

/* ==================== Server Details Page ==================== */
.wsm-server-details {
    max-width: 1200px;
}

.wsm-breadcrumb {
    margin-bottom: 20px;
    font-size: 14px;
}

.wsm-breadcrumb a {
    color: #0073aa;
}

.wsm-server-header-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.wsm-server-header-detail h2 {
    margin: 0;
    display: flex;
    align-items: center;
}

.wsm-server-header-detail h2 .wsm-status-indicator {
    margin-right: 12px;
}

.wsm-header-actions {
    display: flex;
    gap: 10px;
}

/* ==================== Panels ==================== */
.wsm-panel {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.wsm-panel h3 {
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    font-size: 16px;
}

.wsm-panel-actions {
    margin-bottom: 15px;
}

.wsm-no-data {
    color: #666;
    font-style: italic;
    padding: 20px;
    text-align: center;
    background: #f9f9f9;
    border-radius: 4px;
}

/* ==================== Status Grid ==================== */
.wsm-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.wsm-status-item {
    padding: 15px;
    background: #f9f9f9;
    border-radius: 6px;
}

.wsm-status-label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.wsm-status-value {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.wsm-status-value.online {
    color: #46b450;
}

.wsm-status-value.offline {
    color: #dc3232;
}

.wsm-progress-bar {
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    margin-top: 8px;
    overflow: hidden;
}

.wsm-progress {
    height: 100%;
    background: #0073aa;
    border-radius: 3px;
    transition: width 0.3s;
}

/* ==================== Tables ==================== */
.wsm-table {
    width: 100%;
    border-collapse: collapse;
}

.wsm-table th,
.wsm-table td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.wsm-table th {
    font-weight: 600;
    color: #333;
    background: #f9f9f9;
}

.wsm-table tbody tr:hover {
    background: #f9f9f9;
}

.wsm-table .wsm-actions {
    white-space: nowrap;
}

.wsm-table .wsm-actions .button {
    margin-right: 5px;
    margin-bottom: 5px;
}

/* ==================== Badges ==================== */
.wsm-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.wsm-badge.admin { background: #dc3232; color: #fff; }
.wsm-badge.user { background: #0073aa; color: #fff; }
.wsm-badge.enabled { background: #46b450; color: #fff; }
.wsm-badge.disabled { background: #999; color: #fff; }

.wsm-badge.status-pending { background: #fff3cd; color: #856404; }
.wsm-badge.status-running { background: #cce5ff; color: #004085; }
.wsm-badge.status-completed { background: #d4edda; color: #155724; }
.wsm-badge.status-failed { background: #f8d7da; color: #721c24; }

.wsm-badge.active { background: #46b450; color: #fff; }
.wsm-badge.disc { background: #ffb900; color: #333; }

.wsm-error {
    color: #dc3232;
    font-size: 12px;
}

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

.wsm-modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.wsm-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.wsm-modal-close:hover {
    color: #333;
}

.wsm-modal h3 {
    margin: 0 0 20px 0;
}

.wsm-modal label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.wsm-modal input[type="text"],
.wsm-modal input[type="password"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 5px;
}

.wsm-modal p {
    margin-bottom: 15px;
}

.wsm-modal-actions {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

/* ==================== Buttons ==================== */
.button-link-delete {
    color: #dc3232 !important;
    border-color: #dc3232 !important;
}

.button-link-delete:hover {
    background: #dc3232 !important;
    color: #fff !important;
}

/* ==================== Loading State ==================== */
.wsm-loading {
    opacity: 0.6;
    pointer-events: none;
}

.wsm-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: wsm-spin 1s linear infinite;
}

@keyframes wsm-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==================== Responsive ==================== */
@media screen and (max-width: 768px) {
    .wsm-servers-grid {
        grid-template-columns: 1fr;
    }
    
    .wsm-server-header-detail {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .wsm-header-actions {
        width: 100%;
    }
    
    .wsm-header-actions .button {
        flex: 1;
    }
    
    .wsm-status-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .wsm-table {
        font-size: 14px;
    }
    
    .wsm-table th,
    .wsm-table td {
        padding: 8px 5px;
    }
    
    .wsm-table .wsm-actions {
        display: flex;
        flex-direction: column;
    }
    
    .wsm-table .wsm-actions .button {
        margin-right: 0;
    }
}

@media screen and (max-width: 480px) {
    .wsm-status-grid {
        grid-template-columns: 1fr;
    }
    
    .wsm-server-actions {
        flex-direction: column;
    }
    
    .wsm-server-actions .button {
        width: 100%;
    }
}
