﻿/* ===== COLOR VARIABLES ===== */
:root {
    --header-bg: #7310af;
    --sidebar-bg: #37b148;
    --main-bg: #caf0f8;
    --footer-bg: #616161;
    --text-light: #ffffff;
}

/* ===== RESET & BASE STYLES ===== */
html, body {
    margin: 0;
    padding: 0;
    height: 100vh; /* Full viewport height */
    overflow: hidden; /* Prevent window scroll */
    font-family: Arial, sans-serif;
}

/* ===== MAIN LAYOUT CONTAINER ===== */
#app-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== HEADER ===== */
/* ===== HEADER ===== */
.header {
    background: var(--header-bg);
    color: var(--text-light);
    height: 80px;
    padding: 0 30px;
    flex-shrink: 0; /* Prevent header shrink */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Left Section (Logo + Search) */
.header-left {
    display: flex;
    align-items: center;
    gap: 30px;
}

.logo {
    font-size: 1.3em;
    font-weight: bold;
    text-decoration: none;
    color: var(--text-light);
    white-space: nowrap; /* Prevent logo text wrapping */
}

.search-container {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    padding: 5px 15px;
    width: 300px; /* Fixed width for search bar */
}

.search-bar {
    background: transparent;
    border: none;
    color: var(--text-light);
    padding: 8px;
    width: 100%; /* Fill container */
    outline: none;
}

    .search-bar::placeholder {
        color: rgba(255, 255, 255, 0.7);
    }

.search-button {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 5px;
}

/* Right Section (Links) */
.header-right {
    display: flex;
    gap: 25px;
}

.header-link {
    color: var(--text-light);
    text-decoration: none;
    font-size: 1em; /* Match sidebar font size */
    padding: 12px 15px; /* Match sidebar padding */
    border-radius: 4px; /* Match sidebar border radius */
    
    background: transparent;
}

    .header-link:hover {
        background: rgba(255, 255, 255, 0.1); /* Subtle hover like sidebar */
        transform: translateX(2px); /* Mimic sidebar’s hover animation */
        opacity: 1 !important; /* Override previous opacity */
    }

/* ===== CONTENT AREA (sidebar + main) ===== */
.content-wrapper {
    flex: 1;
    display: flex;
    min-height: 0; /* Critical for child element scrolling */
}

/* ===== SCROLL BAR ===== */
::-webkit-scrollbar {
    width: 8px;
    background: rgba(0, 0, 0, 0.05);
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

    /* Darken thumb on hover */
::-webkit-scrollbar-thumb:hover {
background: rgba(0, 0, 0, 0.25);

}

/* ===== SIDEBAR ===== */
.sidebar {
    background: var(--sidebar-bg);
    width: 250px;
    padding: 20px 10px 20px 10px; /* Reduce right/left padding */
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
}

.sidebar-item {
    display: block;
    padding: 12px 2px;
    color: var(--text-light);
    text-decoration: none;
    
    border-radius: 4px;
    margin: 5px 0;
    
    max-width: 100%; /* Prevent overflow */
    box-sizing: border-box; /* Include padding in width */
}

.sidebar-item:hover {
 background: #2b8a3e; /* Darker green hover */
transform: translateX(5px);
 }

/* ===== DROPDOWNS ===== */
.dropdown-content {
    width: calc(100% - 15px); /* Account for parent padding */
    max-height: 0;
    overflow: hidden;
    
    padding-left: 15px;
    box-sizing: border-box; /* Critical to prevent overflow */
}


.dropdown.active .dropdown-content {
    max-height: 500px; /* Adjust based on max expected height */
}

.dropdown-header {
    padding-right: 25px; /* Space for ▼ icon */
    position: relative;
}

    /* Position ▼ icon absolutely */
    .dropdown-header::after {
        content: "▼";
        position: absolute;
        right: 10px;
        font-size: 0.8em;
    }

.sidebar-subitem {
    display: block;
    padding: 8px 15px;
    color: var(--text-light);
    text-decoration: none;
    opacity: 0.9;
}

 .sidebar-subitem:hover {
    opacity: 1;
     background: #2b8a3e;

 }

.dropdown.active .dropdown-content {
    display: block;
}


/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--main-bg);
    position: relative;
}


/* ===== FOOTER ===== */
.footer {
    background: var(--footer-bg);
    color: var(--text-light);
    text-align: center;
    padding: 12px 0;
    flex-shrink: 0;
    font-size: 10px;
}
/*===================*/
/*===================*/
/*===================*/
/*===================*/
/*==CRUD OEPRATİONS==*/
/*===================*/
/*===================*/
/*===================*/
/*===================*/

/* CRUD Button Styling */
.header-crud {
    margin-left: 20px;
}

/*CRUD EDİT DELETE START*/
.main-content {
    padding-top: 20px;
}

.crud-actions {
    position: fixed;
    top: 80px; /* Header height */
    left: 270px; /* Sidebar width */
    right: 0px;
    height: 50px;
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    z-index: 99;
    margin-bottom: 20px; /* Space between buttons and content */
}

.btn-edit, .btn-delete {
    flex: 1;
    border: none;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    margin: 0;
    padding: 12px 0; /* Better vertical centering */
}

.btn-edit {
    background: #FFC107;
    color: #212529;
    border-right: 1px solid #dee2e6; /* Divider */
}

.btn-delete {
    background: #DC3545;
    color: white;
}

.btn-edit:hover {
    background: #E0A800;
}

.btn-delete:hover {
    background: #BD2130;
}

/*CRUD EDİT DELETE END*/
/*CRUD FİLES START*/

/* ===== CRUD FORM STYLES ===== */
.crud-container {
    max-width: 800px;
    margin: 30px auto;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.crud-form .form-group {
    margin-bottom: 20px;
}

.crud-form label {
    font-weight: 500;
    margin-bottom: 5px;
    display: block;
}

.crud-form .alert {
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.crud-form .alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.crud-form .alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.crud-form .btn-primary {
    background-color: #7310af;
    border-color: #63109a;
    padding: 8px 20px;
    font-size: 1em;
}

    .crud-form .btn-primary:hover {
        background-color: #63109a;
        border-color: #53107a;
    }

.crud-form .form-control {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box;
}

.crud-form textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

.btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
    padding: 8px 20px;
    font-size: 1em;
    color: white;
}
/*CRUD FİLES END*/

/* CRUD Success/Error Messages */
.alert-message {
    padding: 12px 20px;
    margin: 15px 0;
    border-radius: 4px;
    font-weight: 500;
}

.alert-success {
    background-color: #37b148; /* Your green color */
    color: white;
    border-left: 4px solid #2b8a3e;
}

.alert-danger {
    background-color: #dc3545; /* Your red color */
    color: white;
    border-left: 4px solid #bd2130;
}

.alert-info {
    background-color: #17a2b8;
    color: white;
    border-left: 4px solid #117a8b;
}

/* ===== HEADER CRUD DROPDOWN ===== */
.header-crud {
    position: relative; /* Anchor for absolute positioning */
    display: inline-block; /* Fit to content */
}

.crud-dropdown {
    position: relative;
}

.crud-dropdown-toggle {
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 1em;
    padding: 12px 15px;
    cursor: pointer;
    border-radius: 4px;
}

    .crud-dropdown-toggle:hover {
        background: rgba(255, 255, 255, 0.1);
    }

.crud-dropdown-menu {
    position: absolute;
    top: 100%; /* Position below toggle */
    left: 0;
    background: var(--sidebar-bg);
    min-width: 200px;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 1000;
    display: none; /* Hidden by default */
}

.crud-dropdown:hover .crud-dropdown-menu {
    display: block; /* Show on hover */
}

.crud-dropdown-item {
    display: block;
    padding: 10px 15px;
    color: var(--text-light);
    text-decoration: none;
}

    .crud-dropdown-item:hover {
        background: #2b8a3e;
    }

/* TİTLE STYLİNG */
.necessary-info-title {
    color: #1a237e; /* Dark blue */
    
    margin-bottom: 25px;
    font-size: 1.4em;
    text-transform: uppercase;
}

/* Table Styling */
.legislation-table {
    margin: 0 auto;
    max-width: 1200px;
    overflow-x: auto;
}

    .legislation-table table {
        width: 100%;
        border-collapse: collapse;
        background: white;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }

    .legislation-table th {
        background-color: #7310af; /* Your purple */
        color: white;
        padding: 12px 15px;
        text-align: left;
    }

    .legislation-table td {
        padding: 10px 15px;
        border-bottom: 1px solid #eee;
    }

    .legislation-table tr:nth-child(even) {
        background-color: #f9f9f9;
    }

    .legislation-table tr:hover {
        background-color: #f1f1f1;
    }

.necessary-info-subtitle {
    margin-top: 40px;
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 1.5em;
    
}

.highlight-row {
    background-color: #f8f9fa;
    font-weight: bold;
}

.disclaimer {
    font-size: 0.8em;
    font-style: italic;
    color: #6c757d;
    margin-top: 10px;
    text-align: center;
}

/* ==================== */
/* SUBCATEGORY CONTAINER */
/* ==================== */
.subcategory-container {
    padding: 20px;
    position: relative;
}

.subcategory-columns {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.subcategory-column {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s;
    border-left: 4px solid #7310af;
    position: relative;
    padding-right: 40px;
    width: 100%; /* Full width of container */
    box-sizing: border-box; /* Include padding in width */
}

    .subcategory-column:hover {
        transform: translateX(5px);
        box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    }

.subcategory-header {
    text-decoration: none !important;
    font-size: 1.2em;
    font-weight: bold;
    color: #7310af;
    margin-bottom: 10px;
}

.subcategory-date {
    font-size: 0.9em;
    color: #616161;
    margin-bottom: 10px;
    font-style: italic;
    display: none; /*İ realized that almsot non of the reference pages use "yürürlük tarihi" and as a bandaid solution i decided to hide this part to not cause awkwardness.*/
}

.subcategory-preview {
    color: #333;
    line-height: 1.5;
}

.star-container {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 24px;
    height: 24px;
    z-index: 1;
}

.star {
    position: absolute;
    top: 0;
    left: 0;
    cursor: pointer;
    font-size: 24px;
    color: #ccc;
    transition: all 0.2s;
    display: block;
    width: 24px;
    height: 24px;
    text-align: center;
    line-height: 24px;
}

    .star.favorite {
        color: gold;
        text-shadow: 0 0 2px rgba(0,0,0,0.3);
    }

    .star:hover {
        transform: scale(1.2);
    }

    .star::before {
        content: "☆";
        position: absolute;
        top: 0;
        left: 0;
    }

    .star.favorite::before {
        content: "★";
    }

/* Prevent layout shifts on hover */
.subcategory-column:hover .star {
    transform: none;
}

.card-content {
    display: block;
    width: 100%;
}

/* ============================================== */
/* ===== START OF SEARCH MODE SELECTION BAR ===== */
/* ============================================== */

.search-mode-container {
    display: none; /* Hidden by default */
    position: absolute;
    top: 100%; /* Below search bar */
    left: 0;
    background: #0d47a1; /* Darker blue than main background */
    padding: 10px;
    border-radius: 0 0 4px 4px;
    width: 100%;
    z-index: 100;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.search-mode-btn {
    background: transparent;
    border: none;
    color: white;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

    .search-mode-btn.active {
        background: rgba(255,255,255,0.2);
    }

/* Search bar adjustments */
.search-container {
    position: relative; /* Anchor for absolute positioning */
}

/* Highlight for search results (already added in Phase 1) */
.search-highlight {
    background-color: #FFEB3B;
    padding: 0 2px;
    border-radius: 2px;
}

/* ========================================= */
/* ===== END SEARCH MODE SELECTION BAR ===== */
/* ========================================= */