/* =========================================
   1. GLOBAL VARIABLES & RESET
   ========================================= */
:root {
    /* Marka Renkleri */
    --gsb-red: #E30A17;
    --gsb-dark: #b0060f;
    
    /* Metin Renkleri */
    --text-dark: #333;
    --text-light: #fff;
    --text-grey: #666;
    
    /* Arka Planlar */
    --bg-body: #f4f7fa;
    --bg-pattern-checkered: url("https://transparenttextures.com/patterns/checkered-pattern.png");
    
    /* Düzen Ölçüleri */
    --sidebar-width: 280px;
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

/* Genel Sıfırlama */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-body);
}

/* =========================================
   2. LOGIN PAGE STYLES (Giriş Sayfası)
   ========================================= */

.login-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    background-image: var(--bg-pattern-checkered);
    padding: 20px; /* Mobilde kenarlara yapışmaması için */
}

.login-container-inner {
    width: 90%; /* Responsive: Sabit genişlik yerine yüzde */
    max-width: 900px;
    height: auto; /* Responsive: İçeriğe göre uzasın */
    min-height: 550px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    display: flex;
    overflow: hidden;
    position: relative;
}

/* --- Sol Panel (Kırmızı Alan) --- */
.left-panel {
    flex: 1;
    background: linear-gradient(135deg, var(--gsb-red) 0%, var(--gsb-dark) 100%);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px;
    position: relative;
    overflow: hidden;
}

/* Desen Efekti */
.left-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.header-logo {
    width: 150px;
    display: block;
}

.header-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.hero-content {
    z-index: 2;
    margin-bottom: 40px;
}

.hero-content h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 15px;
}

.hero-content p {
    font-size: 15px;
    opacity: 0.9;
    font-weight: 300;
    line-height: 1.5;
}

/* Arka Plan İllüstrasyonu */
.illustration {
    position: absolute;
    right: -20px;
    bottom: -20px;
    font-size: 200px;
    opacity: 0.1;
    transform: rotate(-15deg);
}

.footer-text {
    font-size: 11px;
    opacity: 0.6;
    z-index: 2;
}

/* --- Sağ Panel (Form Alanı) --- */
.right-panel {
    flex: 1;
    background: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    position: relative;
}

.login-box {
    width: 100%;
    max-width: 320px;
    text-align: center;
}

.login-box h3 {
    font-size: 24px;
    color: var(--text-dark);
    margin-bottom: 10px;
    font-weight: 700;
}

.login-box p {
    color: #666;
    font-size: 14px;
    margin-bottom: 40px;
}

/* E-Devlet Butonu */
.edevlet-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px;
    background-color: var(--gsb-red);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(227, 10, 23, 0.2);
}

.edevlet-btn-img {
    width: 40px;
    height: 40px;
    margin-right: 10px;
    position: relative;
    top: 5px;
}

.edevlet-btn:hover {
    background-color: var(--gsb-dark);
    box-shadow: 0 6px 20px rgba(227, 10, 23, 0.4);
    transform: translateY(-2px);
}

.help-link {
    position: absolute;
    bottom: 30px;
    font-size: 13px;
    color: #888;
    text-decoration: none;
    transition: 0.3s;
}

.help-link:hover {
    color: var(--gsb-red);
}

/* =========================================
   3. DASHBOARD PAGE STYLES
   ========================================= */

.dashboard {
    background-color: var(--bg-body);
    height: 100vh;
}

.dashboard-wrapper {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    height: 100vh;
    width: 100%;
    transition: all 0.3s ease;
}

.dashboard-wrapper.sidebar-closed {
    grid-template-columns: 0 1fr;
}

/* --- Sidebar --- */
.sidebar {
    background: #fff;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    padding: 0 0 20px 0;
    z-index: 100;
    overflow-x: hidden;
    white-space: nowrap;
}

.sidebar-header, .search-box, .sidebar-menu, .sidebar-footer {
    padding-left: 20px;
    padding-right: 20px;
}

.sidebar-header {
    width: 270px;
    height: 70px;
    margin-bottom: 25px;
    padding: 10px 0 0 0;
}

.sidebar-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* =========================================
   MOBILE USER PROFILE (Sidebar İçi)
   ========================================= */

/* Varsayılan olarak (Masaüstü) gizle */
.sidebar-user-mobile {
    display: none;
}

/* 768px ve altı (Mobil/Tablet) için ayarlar */
@media (max-width: 768px) {
    
    /* 1. Header'daki profili gizle */
    .top-header .user-profile {
        display: none !important;
    }

    /* 2. Sidebar içindeki profili göster ve stillendir */
    .sidebar-user-mobile {
        display: block;
        padding: 20px;
        background-color: #fcfcfc;
        border-bottom: 1px solid #eee;
        margin-bottom: 15px;
    }

    .mobile-user-info {
        display: flex;
        align-items: center;
        gap: 15px;
        margin-bottom: 15px;
    }

    /* Avatar stili mevcut CSS'ten miras alacak, ama hizalama için */
    .sidebar-user-mobile .avatar {
        background-color: var(--gsb-red);
        color: white;
        border: none;
        font-size: 14px;
        font-weight: 600;
        width: 45px;
        height: 45px;
    }

    .mobile-user-details {
        display: flex;
        flex-direction: column;
    }

    .mobile-user-details .user-name {
        font-size: 15px;
        font-weight: 700;
        color: var(--text-dark);
    }

    .mobile-user-details .user-role {
        font-size: 12px;
        color: #999;
    }

    .mobile-user-actions {
        display: flex;
        gap: 10px;
    }

    .mobile-action-btn {
        flex: 1;
        padding: 8px;
        border-radius: 8px;
        text-align: center;
        font-size: 13px;
        text-decoration: none;
        color: var(--text-dark);
        background: #f0f0f0;
        transition: 0.2s;
    }

    .mobile-action-btn:hover {
        background: #e0e0e0;
    }

    .mobile-action-btn.logout {
        color: var(--gsb-red);
        background: #fff0f1;
    }

    .mobile-action-btn.logout:hover {
        background: #ffe0e3;
    }
}

/* Search Box */
.search-box {
    position: relative;
    margin-bottom: 20px;
}

.search-box input {
    width: 100%;
    padding: 10px 15px 10px 35px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #f9f9f9;
    font-size: 13px;
}

.search-box input:focus {
    outline: none;
    border-color: var(--gsb-red);
    background: #fff;
}

.search-box i {
    position: absolute;
    left: 32px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 13px;
}

/* Sidebar Menu */
.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.menu-item-single {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    text-decoration: none;
    color: var(--text-grey);
    border-radius: 10px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
}

.menu-item-single:hover {
    background-color: #fff0f1;
    color: var(--gsb-red);
}

.menu-item-single i {
    width: 24px;
    margin-right: 10px;
}

.menu-group {
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    overflow: hidden;
}

.menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    cursor: pointer;
    color: var(--text-grey);
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
    user-select: none;
}

.menu-header:hover {
    background-color: #f9f9f9;
    color: var(--gsb-red);
}

.menu-left {
    display: flex;
    align-items: center;
}

.menu-left i {
    width: 24px;
    margin-right: 10px;
}

.arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.menu-group.open .menu-header {
    color: var(--gsb-red);
    font-weight: 600;
}

.menu-group.open .arrow {
    transform: rotate(180deg);
}

.submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
    background-color: #fff;
}

.menu-group.open .submenu {
    max-height: 500px;
}

.submenu-item {
    display: block;
    padding: 8px 15px 8px 50px;
    font-size: 13px;
    color: #666;
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: 0.2s;
}

.submenu-item:hover {
    color: var(--gsb-red);
    background-color: #fafafa;
}

.submenu-item.active {
    color: var(--gsb-red);
    border-left-color: var(--gsb-red);
    background-color: #fff0f1;
    font-weight: 600;
}

.sidebar-footer {
    font-size: 11px;
    color: #aaa;
    text-align: center;
    margin-top: 20px;
}

/* --- Header & Main Content --- */
.main-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
}

.top-header {
    height: 70px;
    background: linear-gradient(135deg, var(--gsb-red) 0%, var(--gsb-dark) 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    color: #fff;
    position: relative;
    flex-shrink: 0;
}

.top-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 2;
}

.header-left h2 {
    font-size: 18px;
    font-weight: 600;
}

.hamburger {
    cursor: pointer;
    font-size: 20px;
    opacity: 0.8;
}

.header-right {
    z-index: 2;
}

/* Profil Dropdown */
.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    position: relative;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
}

.avatar {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.4);
}

.profile-dropdown {
    position: absolute;
    top: 60px;
    right: 0;
    width: 200px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.15);
    padding: 10px;
    display: none;
    flex-direction: column;
    z-index: 1000;
    border: 1px solid #f0f0f0;
    animation: fadeIn 0.2s ease;
}

.profile-dropdown.active {
    display: flex;
}

.dropdown-header {
    padding: 8px 12px;
    font-size: 11px;
    text-transform: uppercase;
    color: #999;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    text-decoration: none;
    color: var(--text-dark);
    font-size: 14px;
    border-radius: 8px;
    transition: all 0.2s;
}

.dropdown-item:hover {
    background-color: #f9f9f9;
    color: var(--gsb-red);
}

.dropdown-item.logout:hover {
    background-color: #fff0f1;
    color: var(--gsb-red);
}

.dropdown-divider {
    height: 1px;
    background-color: #eee;
    margin: 5px 0;
}

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

/* --- Content Grid & Cards --- */
.content-container {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.page-title-section {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
}

.text-gsb {
    color: var(--gsb-red);
    font-size: 20px;
}

.page-title-section h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    padding-bottom: 40px;
    width: 100%;
}

.app-card {
    background: #fff;
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: space-between;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    border: 1px solid transparent;
}

.app-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    border-color: #fceceb;
}

.card-icon {
    width: 80px;
    height: 80px;
    background: #fdf2f3;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: var(--gsb-red);
    font-size: 32px;
}

.app-card h4 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.app-card p {
    font-size: 13px;
    color: #777;
    margin-bottom: 25px;
    line-height: 1.5;
}

.app-btn {
    display: inline-block;
    padding: 10px 25px;
    background-color: var(--gsb-red);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    transition: 0.3s;
    box-shadow: 0 4px 10px rgba(227, 10, 23, 0.2);
}

.app-btn:hover {
    background-color: var(--gsb-dark);
    box-shadow: 0 6px 15px rgba(227, 10, 23, 0.3);
}

.app-btn.btn-outline {
    background: transparent;
    border: 2px solid #e0e0e0;
    color: var(--text-grey);
    box-shadow: none;
}

.app-btn.btn-outline:hover {
    border-color: var(--text-dark);
    color: var(--text-dark);
    background: #fff;
    transform: translateY(-2px);
}

/* =========================================
   4. ERROR PAGE STYLES (Yeni Eklenen)
   ========================================= */

.error-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-body);
    background-image: var(--bg-pattern-checkered);
    padding: 20px;
}

.error-header {
    margin-bottom: 30px;
}

.error-logo {
    height: 80px;
    width: auto;
}

.error-card {
    background: #fff;
    width: 100%;
    max-width: 500px;
    padding: 50px 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
    text-align: center;
    animation: fadeInUp 0.5s ease-out;
}

.error-icon-box {
    width: 100px;
    height: 100px;
    background: #fdf2f3;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px auto;
}

.error-icon-box i {
    font-size: 48px;
    color: var(--gsb-red);
}

.error-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 15px;
}

.error-desc {
    font-size: 15px;
    color: var(--text-grey);
    line-height: 1.6;
    margin-bottom: 40px;
}

.error-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.error-footer {
    margin-top: 40px;
    font-size: 12px;
    color: #999;
}

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

/* =========================================
   5. MEDIA QUERIES (Responsive Ayarlar)
   ========================================= */

/* Küçük Masaüstü ve Tabletler (1200px altı) */
@media (max-width: 1200px) {
    .apps-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablet ve Geniş Mobiller (900px altı) - Login Sayfası Kırılımı */
@media (max-width: 900px) {
    /* Login Kartı Dikey Oluyor */
    .login-container-inner {
        flex-direction: column;
        width: 90%;
        height: auto;
        min-height: auto;
        margin: 20px 0;
    }

    .left-panel {
        width: 100%;
        flex: none;
        padding: 40px 30px;
        text-align: center;
        align-items: center;
    }

    .header-logo {
        width: 120px;
        margin: 0 auto 20px auto;
    }

    .hero-content h2 {
        font-size: 24px;
    }
    
    .hero-content p {
        font-size: 14px;
        max-width: 400px;
        margin: 0 auto;
    }

    .illustration {
        font-size: 120px;
        right: 10px;
        bottom: 10px;
        opacity: 0.08;
    }

    .footer-text {
        display: none;
    }

    .right-panel {
        width: 100%;
        flex: none;
        padding: 40px 30px;
    }

    .login-box {
        max-width: 100%;
    }
    
    .help-link {
        position: relative;
        bottom: auto;
        margin-top: 30px;
        display: block;
        text-align: center;
    }
}

/* Tablet ve Altı (768px altı) - Dashboard Kırılımı */
@media (max-width: 768px) {
    .dashboard-wrapper {
        display: block;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        height: 100vh;
        width: 280px;
        transition: all 0.3s ease;
        padding: 20px 0;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .apps-grid {
        grid-template-columns: 1fr;
    }
    
    .top-header {
        padding: 0 20px;
    }
    
    .content-container {
        padding: 20px;
    }
    
    .hamburger {
        z-index: 1001;
    }

    .profile-dropdown {
        right: -20px;
    }
}

/* Çok Küçük Ekranlar (480px altı) */
@media (max-width: 480px) {
    .left-panel, .right-panel {
        padding: 30px 20px;
    }
    
    .hero-content h2 {
        font-size: 22px;
    }

    .error-actions {
        flex-direction: column;
    }
    
    .app-btn {
        width: 100%;
        text-align: center;
    }
}