/* Import Vazir Font from Google Fonts CDN */
@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazir-font@v30.1.0/dist/font-face.css');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazir', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    max-width: 400px;
    width: 100%;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 24px;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
header {
    background: white;
    padding: 20px 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

header h1 {
    color: #333;
    font-size: 28px;
}

/* Cards */
.status-card,
.controls-card,
.logs-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.status-card h2,
.controls-card h2,
.logs-card h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 22px;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

/* Status Grid */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.status-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.stat-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-label {
    font-size: 14px;
    color: #666;
    font-weight: 600;
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
    color: #667eea;
}

/* Button Icons */
.btn-icon {
    font-size: 18px;
    margin-left: 8px;
}

.btn-text {
    font-size: 16px;
}

/* Logs Header Row */
.logs-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.logs-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.logs-info {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
}
.status-indicator {
    display: flex;
    align-items: center;
    font-size: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.status-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-left: 15px;
    animation: pulse 2s infinite;
}

.status-online {
    background: #28a745;
    box-shadow: 0 0 10px #28a745;
}

.status-offline {
    background: #dc3545;
    box-shadow: 0 0 10px #dc3545;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.status-text {
    font-weight: bold;
    color: #333;
}

/* Buttons */
.button-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-warning {
    background: #ffc107;
    color: #333;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

/* Form */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Vazir', sans-serif;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

/* Message */
.message {
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    display: none;
    font-weight: bold;
}

.message.show {
    display: block;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Alert */
.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: bold;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Logs */
.logs-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 15px;
}

#logs {
    background: #1e1e1e;
    color: #00ff00;
    padding: 20px;
    border-radius: 10px;
    max-height: 400px;
    overflow-y: auto;
    font-family: 'Vazir Code', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.8;
    direction: ltr;
    text-align: left;
}

#logs::-webkit-scrollbar {
    width: 10px;
}

#logs::-webkit-scrollbar-track {
    background: #2d2d2d;
    border-radius: 10px;
}

#logs::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 10px;
}

#logs::-webkit-scrollbar-thumb:hover {
    background: #777;
}

/* Loading Animation */
.loading {
    pointer-events: none;
    opacity: 0.6;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 15px;
    }
    
    .button-group {
        grid-template-columns: 1fr;
    }
    
    .status-card,
    .controls-card,
    .logs-card {
        padding: 20px;
    }
}