@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root, [data-theme="dark"] {
    --bg-color: #0f172a;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --danger: #ef4444;
    --success: #10b981;
    --body-gradient: radial-gradient(circle at top right, #1e1b4b, #0f172a 40%, #020617);
    --input-bg: rgba(15, 23, 42, 0.5);
}

[data-theme="light"] {
    --bg-color: #f8fafc;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.1);
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --text-main: #0f172a;
    --text-muted: #475569;
    --body-gradient: radial-gradient(circle at top right, #e0e7ff, #f1f5f9 40%, #e2e8f0);
    --input-bg: rgba(255, 255, 255, 0.8);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image: var(--body-gradient);
    padding: 1rem;
}

.glass-container {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.5s ease-out;
}

.dashboard-container {
    max-width: 1000px;
}

.dashboard-container.wide {
    max-width: 90%;
    width: 100%;
    padding: 1.5rem;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
input[type="url"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 1rem;
    transition: all 0.3s;
    font-family: inherit;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
    outline: none;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}

textarea {
    resize: vertical;
}

.captcha-wrapper {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.captcha-display {
    background: var(--glass-border);
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-weight: 700;
    letter-spacing: 2px;
    font-size: 1.2rem;
    user-select: none;
    border: 1px dashed var(--primary);
}

.btn {
    width: 100%;
    padding: 0.875rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(1px);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.checkbox-group input {
    accent-color: var(--primary);
    width: 1rem;
    height: 1rem;
    cursor: pointer;
}

.checkbox-group label {
    margin: 0;
    cursor: pointer;
}

.alert {
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.alert.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.dashboard-header h1 {
    margin: 0;
}

.btn-sm {
    width: auto;
    padding: 0.5rem 1rem;
    background: var(--glass-border);
    color: var(--text-main);
    font-size: 0.875rem;
}
.btn-sm:hover {
    background: rgba(239, 68, 68, 0.8);
}


/* Dashboard Grid Menu */
.grid-menu {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.menu-item {
    background: var(--glass-border);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.menu-item:hover {
    background: var(--glass-bg);
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 20px -10px rgba(59, 130, 246, 0.5);
}

/* Theme Toggle Button */
.theme-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 100;
}

.home-btn {
    position: absolute;
    top: 1rem;
    right: 4rem; /* theme-toggle'ın 1rem + 40px solunda */
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 100;
    text-decoration: none;
}

.theme-toggle:hover, .home-btn:hover {
    transform: scale(1.1);
}

.theme-toggle svg, .home-btn svg {
    width: 20px;
    height: 20px;
}

.menu-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    color: var(--primary);
    transition: all 0.3s ease;
}

.menu-item span {
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
}

/* Responsive adjustments for desktop */
@media (min-width: 768px) {
    .grid-menu {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 1rem;
    }
    
    .menu-item {
        padding: 1rem 0.5rem;
    }

    .menu-icon {
        width: 32px;
        height: 32px;
        margin-bottom: 0.75rem;
    }

    .menu-item span {
        font-size: 0.8rem;
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}
.modal-overlay.show {
    display: flex;
}
.modal-content {
    background: var(--bg-main); /* solid background fallback */
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}
[data-theme='dark'] .modal-content {
    background: #1e1e2d; /* Make it solid dark so inputs don't bleed from behind */
}
[data-theme='light'] .modal-content {
    background: #ffffff; /* Make it solid light */
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.5rem;
}
.modal-close {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.3s;
}
.modal-close:hover {
    opacity: 1;
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        padding: 1rem;
    }
    .modal-content form > div[style*="grid"],
    .dashboard-container form > div[style*="grid"] {
        grid-template-columns: 1fr !important;
    }
}

/* Sunucu İzleme CSS */
.server-status-widget {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
    justify-content: space-between;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-top: 2rem;
    box-shadow: var(--shadow-sm);
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.status-icon {
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
}

.status-info {
    display: flex;
    flex-direction: column;
}

.status-title {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.status-val {
    font-size: 0.95rem;
    color: var(--text-main);
    font-weight: 600;
}

.status-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

@media (max-width: 768px) {
    .server-status-widget {
        flex-direction: column;
        align-items: stretch;
    }
    .status-actions {
        margin-left: 0;
        margin-top: 1rem;
        justify-content: center;
    }
}

.monitor-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.monitor-card h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

.monitor-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--glass-border);
}

.monitor-label {
    flex: 1;
    min-width: 150px;
    font-weight: 500;
    color: var(--text-main);
}

.monitor-value {
    flex: 2;
    min-width: 250px;
}

.progress-bar-container {
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    height: 12px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-bar {
    height: 100%;
    transition: width 0.5s ease-in-out;
}

.monitor-table th, .monitor-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-main);
}

.monitor-table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 500;
}
.status-active {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}
.status-inactive {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}
