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

body {
    background-color: #1e1e1e;
    color: #e0e0e0;
    font-family:
        system-ui,
        -apple-system,
        sans-serif;
    padding: 2rem 1rem;
}

.container {
    max-width: 896px;
    margin: 0 auto;
    width: 100%;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #3f3f3f;
}

h1 {
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: -0.025em;
}

.auth-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.username-display {
    font-size: 0.875rem;
    color: #3583e4;
    margin-right: 0.5rem;
    font-weight: 600;
    background: rgba(53, 131, 228, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

button,
.file-label-btn {
    background-color: #2d2d2d;
    color: #e0e0e0;
    border: 1px solid #3f3f3f;
    padding: 0.4rem 0.9rem;
    font-size: 0.875rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.15s;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

button:hover,
.file-label-btn:hover {
    background-color: #353535;
    border-color: #52525b;
}

button.btn-primary {
    background-color: #3583e4;
    border-color: #1c71d8;
    color: white;
}

button.btn-primary:hover {
    background-color: #1c71d8;
}

button.btn-danger {
    background-color: #e01b24;
    border-color: #a51d24;
    color: white;
}

button.btn-danger:hover {
    background-color: #c01c24;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
    width: 100%;
}

.adwaita-input {
    background-color: #242424;
    border: 1px solid #3f3f3f;
    color: #e0e0e0;
    padding: 0.6rem 1rem;
    border-radius: 0.375rem;
    font-size: 1rem;
    width: 100%;
}

.adwaita-input:focus {
    border-color: #3583e4;
    outline: none;
    box-shadow: 0 0 0 2px rgba(53, 131, 228, 0.2);
}

.filter-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.tab-btn {
    background: none;
    border: none;
    color: #71717a;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 0.25rem;
}

.tab-btn.active {
    color: #3583e4;
    background: rgba(53, 131, 228, 0.1);
    font-weight: 600;
}

.categories {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.25rem 0;
    width: 100%;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex-wrap: nowrap;
}

.categories::-webkit-scrollbar {
    display: none;
}

.cat-btn {
    border-radius: 9999px;
    font-size: 0.75rem;
    white-space: nowrap;
    background-color: #2d2d2d;
    border-color: #3f3f3f;
    color: #a1a1aa;
    padding: 0.35rem 0.85rem;
    flex-shrink: 0;
}

.cat-btn.active {
    background-color: #e0e0e0;
    color: #1e1e1e;
    border-color: #e0e0e0;
    font-weight: 600;
}

.recipes-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.adwaita-card {
    background-color: #2d2d2d;
    border: 1px solid #3f3f3f;
    padding: 1.5rem;
    border-radius: 0.5rem;
    position: relative;
}

.recipe-clickable {
    cursor: pointer;
}

.adwaita-card:hover {
    border-color: #71717a;
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.card-category {
    font-family: monospace;
    font-size: 0.75rem;
    color: #3583e4;
    text-transform: uppercase;
    font-weight: 700;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: 0.35rem;
    color: #f4f4f5;
}

.card-author {
    font-size: 0.8rem;
    color: #71717a;
    margin-top: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-actions {
    display: flex;
    gap: 0.25rem;
}

.hidden {
    display: none !important;
}

.view-layout {
    position: relative;
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: #a1a1aa;
    font-size: 0.875rem;
}

.close-btn:hover {
    color: white;
}

.view-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: #a1a1aa;
    margin-bottom: 1.5rem;
    align-items: center;
}

.meta-tag {
    background-color: #242424;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    color: #d4d4d8;
    font-weight: 500;
}

.view-body {
    border-top: 1px solid #3f3f3f;
    padding-top: 1rem;
    line-height: 1.6;
}

.recipe-form-element {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

textarea.adwaita-input {
    font-family: monospace;
    resize: vertical;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 50;
    backdrop-filter: blur(4px);
}

.modal-content {
    width: 100%;
    max-width: 28rem;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.025em;
}

.modal-error {
    font-size: 0.875rem;
    margin-top: 0.5rem;
    padding: 0.5rem;
    border-radius: 0.25rem;
    text-align: center;
}

.error-text {
    background-color: rgba(224, 27, 36, 0.15);
    color: #ff8484;
    border: 1px solid rgba(224, 27, 36, 0.3);
}

.success-text {
    background-color: rgba(46, 194, 126, 0.15);
    color: #84ffb6;
    border: 1px solid rgba(46, 194, 126, 0.3);
}

.admin-user-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid #3f3f3f;
    font-size: 0.875rem;
}

.admin-user-row:last-child {
    border-bottom: none;
}

.admin-data-zone {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #3f3f3f;
}

.admin-data-zone h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #a1a1aa;
}

.admin-data-buttons {
    display: flex;
    gap: 0.5rem;
}

/* Dashboard Controls Alignment */
.dashboard-controls-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
    width: 100%;
}

.add-recipe-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    padding: 0.6rem 1.2rem;
}

/* Full-Width Search Bar */
.search-row {
    width: 100%;
    margin-bottom: 1rem;
}

.wide-search {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
}

.categories-row {
    width: 100%;
    margin-bottom: 1.5rem;
}

.admin-users-list div {
    border-bottom: 1px solid #2d2d2d;
    font-size: 0.95rem;
}

/* Ana Kontrol Satırı Konteyneri */
.dashboard-controls-navigation {
    display: flex;
    justify-content: space-between;
    align-items: flex-end; /* Sekmelerin alt çizgisiyle buton tabanını sıfırlar */
    width: 100%;
    border-bottom: 2px solid #2d2d2d; /* Boydan boya uzanan alt çizgi */
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
}

/* Sekme Grupları */
.menu-tabs {
    display: flex;
    gap: 0.75rem;
}

/* Genel Boyutları Bir Tık Artırılmış Sekme Butonları */
.tab-btn {
    background: transparent;
    border: none;
    color: #888;
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease;
}

.tab-btn.active {
    color: #3584e4;
    border-bottom: 3px solid #3584e4;
    margin-bottom: -0.65rem; /* Çizginin tam üzerine basması için kalibre edildi */
}

/* Sağa Hizalı Add New Recipe Butonu (Boyutları Sekmelerle Eşitlendi) */
.add-recipe-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    font-weight: 600;
    height: 2.5rem; /* Dikey yükseklik sabitleyici */
    box-sizing: border-box;
}

/* Boydan Boya Arama Çubuğu */
.search-row {
    width: 100%;
    margin-bottom: 1.25rem;
}

.wide-search {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0.8rem 1.2rem !important; /* Giriş alanı boyutu artırıldı */
    font-size: 1rem !important;
    box-sizing: border-box;
}

/* Kategoriler Alanı */
.categories-row {
    width: 100%;
    margin-bottom: 2rem;
}

.categories .cat-btn {
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
}

footer {
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 1px solid #27272a;
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #52525b;
}

@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
        padding: 0 !important;
        font-size: 12pt;
    }
    .container {
        max-width: 100% !important;
        margin: 0 !important;
        width: 100% !important;
    }
    header,
    .controls,
    footer,
    .close-btn,
    button,
    #form-section,
    #main-content {
        display: none !important;
    }
    .adwaita-card {
        background: #ffffff !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    #view-section {
        display: block !important;
        border: none !important;
        padding: 0 !important;
    }
    #view-title {
        color: #000000 !important;
        font-size: 24pt !important;
        margin-bottom: 10pt !important;
        font-weight: bold;
    }
    .view-meta {
        color: #555555 !important;
        font-size: 10pt !important;
        margin-bottom: 20pt !important;
        border-bottom: 2px solid #000000;
        padding-bottom: 10pt;
    }
    .meta-tag {
        background: none !important;
        color: #000000 !important;
        font-weight: bold;
        padding: 0 !important;
    }
    #view-content {
        white-space: pre-wrap;
        word-wrap: break-word;
        line-height: 1.6;
    }

    #view-content p {
        margin-top: 0;
        margin-bottom: 1.2rem;
    }

    #view-content ul,
    #view-content ol {
        margin-top: 0;
        margin-bottom: 1.2rem;
        padding-left: 1.5rem;
    }

    #view-content li {
        margin-bottom: 0.4rem;
    }
}

@media (min-width: 768px) {
    body {
        padding: 4rem 2rem;
    }
    .controls {
        flex-direction: row;
        align-items: flex-end;
    }
    .recipes-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
