/* 
 * Minecraft Hosting CSS - Thiết kế giống Aternos
 * Tác giả: Minecraft Hosting Team
 * Mô tả: Dark theme với accent màu xanh lá, responsive design
 */

/* ===== RESET VÀ GLOBAL STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #0c0c0c 0%, #1a1a1a 100%);
    color: #ffffff;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== BIẾN CSS ===== */
:root {
    --primary-green: #4CAF50;
    --primary-green-hover: #45a049;
    --primary-green-dark: #388e3c;
    --background-dark: #0c0c0c;
    --background-card: #1e1e1e;
    --background-hover: #2a2a2a;
    --border-color: #333333;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #808080;
    --danger-color: #f44336;
    --warning-color: #ff9800;
    --success-color: #4caf50;
    --info-color: #2196f3;
    --shadow-light: 0 2px 10px rgba(0,0,0,0.3);
    --shadow-heavy: 0 10px 30px rgba(0,0,0,0.5);
    --border-radius: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

a {
    color: var(--primary-green);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-green-hover);
    text-decoration: underline;
}

/* ===== CONTAINER VÀ LAYOUT ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-fluid {
    width: 100%;
    padding: 0 20px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.col {
    flex: 1;
    padding: 0 15px;
}

.col-12 { width: 100%; }
.col-6 { width: 50%; }
.col-4 { width: 33.333%; }
.col-3 { width: 25%; }

/* ===== HEADER ===== */
.header {
    background: var(--background-card);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-green);
}

.logo-icon {
    width: 32px;
    height: 32px;
    margin-right: 10px;
    background: var(--primary-green);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--background-hover);
    text-decoration: none;
}

.nav-link.active {
    color: var(--primary-green);
    background: rgba(76, 175, 80, 0.1);
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    gap: 8px;
    background: transparent;
    color: var(--text-primary);
}

.btn-primary {
    background: var(--primary-green);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-green-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
}

.btn-secondary {
    background: var(--background-card);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--background-hover);
    border-color: var(--primary-green);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #d32f2f;
}

.btn-outline {
    border: 2px solid var(--primary-green);
    color: var(--primary-green);
}

.btn-outline:hover {
    background: var(--primary-green);
    color: white;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ===== HERO SECTION ===== */
.hero {
    padding: 120px 0;
    text-align: center;
    background: linear-gradient(135deg, var(--background-dark) 0%, #1a1a1a 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="cube" patternUnits="userSpaceOnUse" width="20" height="20"><rect width="20" height="20" fill="%23111111"/><rect width="10" height="10" fill="%23222222"/></pattern></defs><rect width="100" height="100" fill="url(%23cube)"/></svg>');
    opacity: 0.1;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-green), #66bb6a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== FEATURES SECTION ===== */
.features {
    padding: 80px 0;
    background: var(--background-card);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature-card {
    background: var(--background-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-light);
    border-color: var(--primary-green);
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 24px;
}

.feature-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.feature-description {
    color: var(--text-secondary);
}

/* ===== DASHBOARD STYLES ===== */
.dashboard {
    padding: 2rem 0;
    min-height: calc(100vh - 80px);
}

.dashboard-header {
    margin-bottom: 2rem;
}

.dashboard-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.dashboard-subtitle {
    color: var(--text-secondary);
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--background-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-green);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ===== SERVER LIST ===== */
.servers-section {
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 0;
}

.server-list {
    display: grid;
    gap: 1rem;
}

.server-card {
    background: var(--background-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    transition: var(--transition);
}

.server-card:hover {
    border-color: var(--primary-green);
    box-shadow: var(--shadow-light);
}

.server-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.server-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0;
}

.server-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-online {
    background: rgba(76, 175, 80, 0.2);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.status-offline {
    background: rgba(244, 67, 54, 0.2);
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}

.status-starting {
    background: rgba(255, 152, 0, 0.2);
    color: var(--warning-color);
    border: 1px solid var(--warning-color);
}

.server-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.server-info-item {
    text-align: center;
}

.server-info-value {
    font-weight: 600;
    color: var(--text-primary);
}

.server-info-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.server-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ===== PROGRESS BARS ===== */
.progress {
    background: var(--background-dark);
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-green), var(--primary-green-hover));
    border-radius: 10px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--background-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

/* ===== MODAL ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--background-card);
    border-radius: var(--border-radius);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    transform: scale(0.7);
    transition: var(--transition);
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    margin: 0;
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--background-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* ===== LOADING STATES ===== */
.loading {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.skeleton {
    background: linear-gradient(90deg, var(--background-dark) 25%, var(--background-hover) 50%, var(--background-dark) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: var(--border-radius);
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== ALERTS ===== */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-success {
    background: rgba(76, 175, 80, 0.1);
    border-color: var(--success-color);
    color: var(--success-color);
}

.alert-danger {
    background: rgba(244, 67, 54, 0.1);
    border-color: var(--danger-color);
    color: var(--danger-color);
}

.alert-warning {
    background: rgba(255, 152, 0, 0.1);
    border-color: var(--warning-color);
    color: var(--warning-color);
}

.alert-info {
    background: rgba(33, 150, 243, 0.1);
    border-color: var(--info-color);
    color: var(--info-color);
}

/* ===== FOOTER ===== */
.footer {
    background: var(--background-card);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0 1rem;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary-green);
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    text-align: center;
    color: var(--text-secondary);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .navbar {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-menu {
        gap: 1rem;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .server-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .server-actions {
        width: 100%;
        justify-content: center;
    }
    
    .modal-content {
        margin: 1rem;
        width: calc(100% - 2rem);
    }
    
    .col-6, .col-4, .col-3 {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 80px 0;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .features {
        padding: 60px 0;
    }
    
    .dashboard {
        padding: 1rem 0;
    }
    
    .server-info {
        grid-template-columns: 1fr;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ===== UTILITIES ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }

.align-center { align-items: center; }
.align-start { align-items: flex-start; }
.align-end { align-items: flex-end; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

/* ===== ANIMATION CLASSES ===== */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-up {
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* ===== ADSENSE STYLES ===== */
.ad-banner {
    margin: 2rem 0;
    text-align: center;
    padding: 1rem;
    background: var(--background-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.ad-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

/* ===== CONNECTION STATUS ===== */
.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--background-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.connection-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transition: var(--transition);
}

.connection-indicator.connected {
    background: var(--success-color);
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.5);
    animation: pulse-green 2s infinite;
}

.connection-indicator.disconnected {
    background: var(--danger-color);
    box-shadow: 0 0 8px rgba(244, 67, 54, 0.5);
    animation: pulse-red 2s infinite;
}

@keyframes pulse-green {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes pulse-red {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ===== REAL-TIME INDICATORS ===== */
.realtime-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    background: var(--primary-green);
    color: white;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.realtime-badge.active {
    animation: pulse-green 2s infinite;
}

.server-status-indicator {
    position: relative;
    padding-left: 20px;
}

.server-status-indicator::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--danger-color);
}

.server-status-indicator.running::before {
    background: var(--success-color);
    animation: pulse-green 2s infinite;
}

.server-status-indicator.starting::before {
    background: var(--warning-color);
    animation: pulse-orange 2s infinite;
}

.server-status-indicator.stopping::before {
    background: var(--warning-color);
    animation: pulse-orange 2s infinite;
}

@keyframes pulse-orange {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--background-card);
    border-radius: var(--border-radius);
    padding: 16px 20px;
    box-shadow: var(--shadow-heavy);
    z-index: 10000;
    min-width: 320px;
    max-width: 500px;
    border-left: 4px solid;
    animation: slideInRight 0.3s ease-out;
}

.toast.toast-success {
    border-left-color: var(--success-color);
}

.toast.toast-error {
    border-left-color: var(--danger-color);
}

.toast.toast-warning {
    border-left-color: var(--warning-color);
}

.toast.toast-info {
    border-left-color: var(--info-color);
}

.toast-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.toast-message {
    flex: 1;
    color: var(--text-primary);
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2em;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    transition: var(--transition);
}

.toast-close:hover {
    background: var(--background-hover);
    color: var(--text-primary);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== CONSOLE STYLES ===== */
.console-output {
    background: #1a1a1a;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    padding: 20px;
    border-radius: var(--border-radius);
    max-height: 500px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.console-output::-webkit-scrollbar {
    width: 8px;
}

.console-output::-webkit-scrollbar-track {
    background: transparent;
}

.console-output::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.console-line {
    margin-bottom: 2px;
    display: block;
}

.console-line.console-command {
    color: #ffff00;
}

.console-line.console-error {
    color: #ff4444;
}

.console-line.console-system {
    color: #44ffff;
}

.console-line.console-result {
    color: #44ff44;
}

.console-line.console-warning {
    color: #ff8800;
}

.console-timestamp {
    color: #888;
    font-size: 0.85em;
    margin-right: 8px;
}

.console-input {
    background: var(--background-card);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    padding: 12px;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.console-input:focus {
    border-color: var(--primary-green);
    outline: none;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

/* ===== PRINT STYLES ===== */
@media print {
    .header, .footer, .btn, .modal, .toast, .connection-status {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
}
