/* Google Fonts - Mevlevi Theme */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Nunito:wght@400;600;700&display=swap');

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

:root {
    /* Mevlevi Renk Paleti */
    --primary: #2D5A4A;        /* Selvi Yeşili */
    --primary-dark: #1E3D32;    /* Koyu Yeşil */
    --secondary: #C9A961;       /* Altın (Zer) */
    --danger: #8B4513;          /* Kahverengi (Somer) */
    --gray: #6B5B4F;            /* Kahve Gri */
    --light-gray: #F5F0E6;       /* Krem (Helva) */
    --border: #D4C9B8;           /* açık krem */
    --shadow: 0 2px 12px rgba(45, 90, 74, 0.15);
    --gold-glow: 0 0 15px rgba(201, 169, 97, 0.3);
}

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--light-gray);
    min-height: 100vh;
}

/* Screens */
.screen {
    min-height: 100vh;
}

.screen.hidden {
    display: none;
}

/* Login/Register */
.login-box {
    max-width: 400px;
    margin: 50px auto;
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
    border: 1px solid var(--border);
}

.login-box h1 {
    margin-bottom: 10px;
    color: var(--primary);
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 32px;
}

.login-subtitle {
    color: var(--gray);
    margin-bottom: 30px;
    font-size: 14px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group input {
    padding: 15px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 16px;
    font-family: 'Nunito', sans-serif;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: var(--gold-glow);
}

.form-group button {
    padding: 15px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    font-family: 'Nunito', sans-serif;
    box-shadow: 0 4px 6px rgba(45, 90, 74, 0.2);
}

.form-group button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(45, 90, 74, 0.3);
}

.form-group button.secondary {
    background: var(--gray);
}

.form-group button.secondary:hover {
    background: #5A4A3F;
}

.error {
    color: #e74c3c;
    background: #fde8e8;
    border: 1px solid #e74c3c;
    padding: 10px 15px;
    border-radius: 8px;
    margin-top: 10px;
    font-size: 14px;
    text-align: center;
    display: none;
}

.error.visible {
    display: block;
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Header */
header {
    background: var(--primary);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(45, 90, 74, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
}

.menu-btn {
    width: 30px;
    height: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    padding: 4px 0;
}

.menu-btn span {
    display: block;
    width: 100%;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s;
}

.header-title {
    font-size: 24px;
    color: white;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    text-align: center;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-right button {
    padding: 8px 15px;
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Nunito', sans-serif;
}

.header-right button:hover {
    background: rgba(255,255,255,0.3);
}

.header-right button.logout {
    background: var(--danger);
    border-color: var(--danger);
}

/* Hamburger Menu */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    display: flex;
    justify-content: flex-start;
}

.menu-overlay.hidden {
    display: none;
}

.menu-content {
    width: 280px;
    height: 100%;
    background: white;
    box-shadow: 4px 0 20px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--primary);
    color: white;
    font-weight: 600;
}

.menu-close {
    background: rgba(255,255,255,0.2) !important;
    border: none !important;
    padding: 8px 12px !important;
    border-radius: 6px !important;
    color: white !important;
    cursor: pointer;
}

.menu-item {
    padding: 18px 25px;
    background: none;
    border: none;
    text-align: left;
    font-size: 16px;
    color: var(--primary-dark);
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
    font-family: 'Nunito', sans-serif;
}

.menu-item:hover {
    background: var(--light-gray);
}

/* Menu Accordion */
.menu-accordion {
    border-bottom: 1px solid var(--border);
}

.menu-accordion-header {
    width: 100%;
    padding: 18px 25px;
    background: none;
    border: none;
    text-align: left;
    font-size: 16px;
    color: var(--primary-dark);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
}

.menu-accordion-header:hover {
    background: var(--light-gray);
}

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

.menu-accordion-content {
    display: none;
    background: rgba(45, 90, 74, 0.05);
}

.menu-accordion-content.open {
    display: block;
}

.menu-sub-item {
    display: block;
    width: 100%;
    padding: 16px 25px;
    background: none;
    border: none;
    border-bottom: 1px solid rgba(45, 90, 74, 0.1);
    text-align: left;
    font-size: 15px;
    color: var(--primary-dark);
    cursor: pointer;
    font-family: 'Nunito', sans-serif;
    transition: background 0.2s;
}

.menu-sub-item:last-child {
    border-bottom: none;
}

.menu-sub-item:hover {
    background: rgba(45, 90, 74, 0.1);
    color: var(--primary);
}

/* Kod Gir Modal */
.modal-desc {
    text-align: center;
    color: var(--gray);
    margin-bottom: 20px;
    font-size: 14px;
}

.kod-input {
    width: calc(100% - 30px);
    padding: 15px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 20px;
    text-align: center;
    letter-spacing: 8px;
    text-transform: uppercase;
    margin-bottom: 20px;
    font-family: 'Playfair Display', serif;
}

.kod-input:focus {
    outline: none;
    border-color: var(--primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-right button {
    padding: 8px 15px;
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Nunito', sans-serif;
}

.header-right button:hover {
    background: rgba(255,255,255,0.3);
}

.header-right button.logout {
    background: var(--danger);
    border-color: var(--danger);
}

/* Main */
main {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Sections */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 18px;
    color: var(--gray);
    font-family: 'Playfair Display', serif;
}

.add-btn {
    padding: 10px 20px;
    background: var(--secondary);
    color: var(--primary-dark);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(201, 169, 97, 0.3);
}

.add-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(201, 169, 97, 0.4);
}

/* Basliklar Grid */
.basliklar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.baslik-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid var(--border);
}

.baslik-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(45, 90, 74, 0.2);
    border-color: var(--secondary);
}

.baslik-card h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--primary);
    font-family: 'Playfair Display', serif;
}

.baslik-card .list-count {
    font-size: 14px;
    color: var(--gray);
}

.baslik-card .delete-btn {
    background: var(--danger);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    margin-top: 10px;
    transition: all 0.3s;
}

.baslik-card .delete-btn:hover {
    opacity: 0.8;
}

.view-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

.view-btn:hover {
    background: var(--primary-dark);
}

.stop-share-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

.stop-share-btn:hover {
    background: #c0392b;
}

.share-btn-stop {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

.share-btn-stop:hover {
    background: #c0392b;
}

.section-header {
    padding: 15px 5px 10px 5px;
    margin-top: 10px;
}

.section-header h2 {
    font-size: 16px;
    color: var(--gray);
    font-weight: 600;
    margin: 0;
}

.shared-card {
    background: linear-gradient(135deg, rgba(45, 90, 74, 0.1) 0%, rgba(201, 169, 97, 0.1) 100%);
    border-left: 4px solid var(--secondary);
}

/* Listeler Listesi */
.listeler-section {
    margin-top: 30px;
}

.listeler-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.liste-card {
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid var(--border);
}

.liste-card:hover {
    background: #FDFCF9;
    border-color: var(--secondary);
}

.liste-card h4 {
    font-size: 16px;
    color: var(--primary);
}

.liste-card .item-count {
    font-size: 14px;
    color: var(--gray);
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(45, 90, 74, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 14px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(45, 90, 74, 0.3);
    border: 1px solid var(--border);
}

.modal-content h3 {
    margin-bottom: 20px;
    text-align: center;
    color: var(--primary);
    font-family: 'Playfair Display', serif;
    font-size: 22px;
}

.modal-content input {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 16px;
    margin-bottom: 10px;
    font-family: 'Nunito', sans-serif;
    transition: all 0.3s;
}

.modal-content input:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: var(--gold-glow);
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-buttons button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    font-family: 'Nunito', sans-serif;
}

.modal-buttons button:first-child {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 6px rgba(45, 90, 74, 0.2);
}

.modal-buttons button:first-child:hover {
    background: var(--primary-dark);
}

.modal-buttons button.secondary {
    background: var(--gray);
    color: white;
}

.modal-buttons button.secondary:hover {
    background: #5A4A3F;
}

/* Fullscreen Modal */
.fullscreen-modal {
    align-items: flex-start;
}

.modal-content-full {
    background: white;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding: 0;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--primary);
    box-shadow: 0 2px 10px rgba(45, 90, 74, 0.3);
    position: sticky;
    top: 0;
}

.modal-header h3 {
    margin: 0;
    color: white;
    font-family: 'Playfair Display', serif;
}

.back-btn {
    padding: 8px 15px;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.back-btn:hover {
    background: rgba(255,255,255,0.2);
}

/* Paylasim Section */
.paylasim-section {
    padding: 20px;
    background: var(--light-gray);
    border-bottom: 1px solid var(--border);
}

.paylasim-form {
    display: flex;
    gap: 10px;
}

.paylasim-form input {
    flex: 1;
    padding: 10px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
}

.paylasim-form button {
    padding: 10px 20px;
    background: var(--secondary);
    color: var(--primary-dark);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
}

.paylasim-kodlari {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.paylasim-kod {
    background: var(--secondary);
    color: var(--primary-dark);
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.paylasim-kod button {
    background: rgba(45, 90, 74, 0.2);
    border: none;
    color: var(--primary-dark);
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.buyuk-kod {
    font-size: 36px;
    font-weight: bold;
    text-align: center;
    color: var(--secondary);
    letter-spacing: 8px;
    margin: 20px 0 5px 0;
    font-family: 'Playfair Display', serif;
    text-shadow: var(--gold-glow);
}

.paylasim-baslik {
    text-align: center;
    color: var(--gray);
    font-size: 14px;
    margin-bottom: 15px;
}

.share-direct-btn {
    display: block;
    width: calc(100% - 40px);
    margin: 0 auto 15px auto;
    padding: 12px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

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

.paylasim-bilgi {
    text-align: center;
    color: var(--gray);
    font-size: 14px;
}

/* Malzeme Ekleme */
.malzeme-ekle {
    padding: 20px;
    background: white;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.malzeme-ekle {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.malzeme-ekle input {
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Nunito', sans-serif;
    transition: all 0.3s;
}

.malzeme-ekle input:focus {
    border-color: var(--secondary);
    box-shadow: var(--gold-glow);
    outline: none;
}

.malzeme-ekle input[type="text"]:first-child {
    flex: 2;
    min-width: 150px;
}

.malzeme-ekle input[type="text"]:nth-child(2) {
    flex: 1;
    min-width: 100px;
}

.malzeme-ekle button {
    padding: 12px 25px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(45, 90, 74, 0.2);
}

.malzeme-ekle button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 20px;
    right: 20px;
    background: white;
    border: 2px solid var(--secondary);
    border-top: none;
    border-radius: 0 0 10px 10px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: var(--gold-glow);
}

.autocomplete-list.hidden {
    display: none;
}

.autocomplete-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background: var(--light-gray);
}

/* Malzemeler List */
.malzemeler-list {
    padding: 20px;
}

.malzeme-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: white;
    border-radius: 10px;
    margin-bottom: 10px;
    box-shadow: var(--shadow);
    gap: 15px;
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.malzeme-item:hover {
    border-color: var(--secondary);
}

.malzeme-item.alindi {
    opacity: 0.6;
    background: var(--light-gray);
}

.malzeme-item.alindi .malzeme-adi {
    text-decoration: line-through;
    color: var(--gray);
}

.malzeme-checkbox {
    width: 24px;
    height: 24px;
    cursor: pointer;
    accent-color: var(--primary);
}

.malzeme-adi {
    flex: 1;
    font-size: 16px;
    color: var(--primary-dark);
}

.malzeme-miktar {
    font-size: 14px;
    color: var(--gray);
    background: var(--light-gray);
    padding: 5px 10px;
    border-radius: 6px;
}

.malzeme-delete {
    background: var(--danger);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: opacity 0.3s;
}

.malzeme-delete:hover {
    opacity: 0.8;
}

/* Share Link Button */
.share-link-btn {
    background: var(--secondary) !important;
    color: var(--primary-dark) !important;
    font-size: 13px;
    font-weight: 600;
}

/* Baslik Actions */
.baslik-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.share-btn-small {
    background: var(--secondary);
    color: var(--primary-dark);
    border: none;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s;
}

.share-btn-small:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.share-code-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.3s;
}

.share-code-btn:hover {
    background: var(--primary-dark);
}

/* Paylasilan Liste */
.paylasilan-liste {
    max-height: 400px;
    overflow-y: auto;
}

.paylasilan-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--light-gray);
    border-radius: 10px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
}

.paylasilan-info h4 {
    margin-bottom: 5px;
    color: var(--primary);
    font-family: 'Playfair Display', serif;
}

.paylasilan-kod {
    font-size: 12px;
    color: var(--secondary);
    font-weight: bold;
}

.paylasilan-item button {
    padding: 8px 15px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.paylasilan-item button:hover {
    background: var(--primary-dark);
}

/* Paylasilan Listeler */
.paylasilan-listeler {
    padding: 20px;
}

.paylasilan-liste-card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.paylasilan-liste-card h4 {
    padding: 15px;
    background: var(--light-gray);
    font-size: 16px;
    color: var(--primary);
    font-family: 'Playfair Display', serif;
    border-bottom: 1px solid var(--border);
}

.paylasilan-liste-card .malzeme-item {
    box-shadow: none;
    border-radius: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
}

/* Responsive */
@media (max-width: 600px) {
    .basliklar-grid {
        grid-template-columns: 1fr;
    }
    
    .malzeme-ekle {
        flex-direction: column;
    }
    
    .malzeme-ekle input,
    .malzeme-ekle button {
        width: 100%;
    }
}