/* ==========================================================================
   Bakım Yönetim Sistemi (CMMS) - Ana CSS Dosyası
   Ortak Layout Stilleri ve Ortak Sınıflar
   Tema Renkleri (Değişkenler) özel CSS dosyalarından (theme/*.css) gelir.
   ========================================================================== */

:root {
    --sidebar-width: 260px;
    --navbar-height: 60px;
    
    /* Default spacing & generic variables */
    --transition-speed: 0.3s;
    --border-radius-sm: 0.25rem;
    --border-radius: 0.375rem;
    --border-radius-lg: 0.5rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --box-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --box-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

/* ==========================================
   Layout: Admin (Sidebar + Navbar)
   ========================================== */
#wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

#sidebar {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: var(--sidebar-color);
    min-height: 100vh;
    transition: all var(--transition-speed);
    z-index: 1000;
    box-shadow: 2px 0 5px rgba(0,0,0,0.05);
}

#sidebar.toggled {
    margin-left: calc(var(--sidebar-width) * -1);
}

#sidebar .sidebar-header {
    padding: 20px;
    height: var(--navbar-height);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

#sidebar .sidebar-header img {
    max-height: 40px;
    max-width: 90%;
}

#sidebar ul.components {
    padding: 10px 0;
}

#sidebar ul p {
    color: rgba(255,255,255,0.5);
    padding: 10px 20px;
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 0;
}

#sidebar ul li a {
    padding: 12px 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    color: var(--sidebar-color);
    text-decoration: none;
    transition: all var(--transition-speed);
    border-left: 3px solid transparent;
}

#sidebar ul li a i {
    margin-right: 10px;
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

#sidebar ul li a:hover,
#sidebar ul li a.active {
    background: var(--sidebar-hover);
    border-left-color: var(--accent-color);
}

#content {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.navbar-custom {
    background: var(--navbar-bg);
    height: var(--navbar-height);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border-bottom: 1px solid var(--border-color);
}

.content-body {
    padding: 20px;
    flex: 1;
}

/* ==========================================
   Card Styles
   ========================================== */
.card {
    border: none;
    box-shadow: var(--box-shadow);
    background-color: var(--card-bg);
    margin-bottom: 20px;
    border-radius: var(--border-radius-lg);
}

.card-header {
    background-color: var(--card-header-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    font-weight: 600;
    color: var(--card-header-color);
}

.card-title {
    margin-bottom: 0;
}

/* ==========================================
   Buttons
   ========================================== */
.btn-primary {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
}

/* ==========================================
   Tables
   ========================================== */
.table {
    color: var(--text-color);
}
.table-responsive {
    border-radius: var(--border-radius);
    overflow: hidden;
}
.table th {
    background-color: var(--table-header-bg);
    border-bottom-width: 1px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.8rem;
}

/* ==========================================
   Footer
   ========================================== */
.developer-footer {
    border-top: 1px solid var(--border-color);
    background-color: var(--footer-bg);
    margin-top: auto;
}

/* ==========================================
   Auth / Login Layout
   ========================================== */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-color);
}
.auth-card {
    width: 100%;
    max-width: 450px;
    box-shadow: var(--box-shadow-lg);
}
.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}
.auth-logo img {
    max-height: 80px;
    max-width: 280px;
}

/* ==========================================
   Utilities & Tweaks
   ========================================== */
.text-accent {
    color: var(--accent-color) !important;
}

.bg-accent {
    background-color: var(--accent-color) !important;
    color: #fff;
}

/* Theme selector preview box */
.theme-preview {
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.2s;
    box-shadow: var(--box-shadow-sm);
}

.theme-preview:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow);
}

.theme-preview.active {
    border-color: var(--accent-color);
}

.theme-preview .preview-header { height: 20px; }
.theme-preview .preview-body { height: 50px; }

/* Responsive adjustments */
@media (max-width: 768px) {
    #sidebar {
        margin-left: calc(var(--sidebar-width) * -1);
    }
    #sidebar.toggled {
        margin-left: 0;
    }
}
