@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Outfit:wght@500;600;700;800&display=swap');

/* --- MODERN & PREMIUM DESIGN SYSTEM --- */
:root {
    /* Color Palette - Indigo & Slate */
    --primary: #4f46e5;       /* Indigo 600 */
    --primary-hover: #4338ca; /* Indigo 700 */
    --primary-light: #e0e7ff; /* Indigo 100 */
    --accent: #0ea5e9;        /* Sky 500 */
    
    --dark: #0f172a;          /* Slate 900 */
    --text: #334155;          /* Slate 700 */
    --text-muted: #64748b;    /* Slate 500 */
    
    --danger: #ef4444;        /* Red 500 */
    --warning: #f59e0b;       /* Amber 500 */
    --success: #10b981;       /* Emerald 500 */
    --success-light: #d1fae5; /* Emerald 100 */

    /* Backgrounds & Glassmorphism */
    --bg-app: #f1f5f9;        /* Slate 100 */
    --bg-sidebar: rgba(255, 255, 255, 0.7);
    --bg-panel: rgba(255, 255, 255, 0.85);
    --bg-input: rgba(248, 250, 252, 0.8);
    --border-light: rgba(226, 232, 240, 0.8);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.07);

    /* Border Radius */
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    height: 100vh;
    overflow: hidden;
    color: var(--text);
}

.app-container {
    display: flex;
    height: 100vh;
    padding: 12px;
    gap: 12px;
}

/* --- GLASSMORPHISM SIDEBAR --- */
.sidebar {
    width: 40%;
    min-width: 480px;
    max-width: 550px;
    flex-shrink: 0;
    background: var(--bg-sidebar);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: var(--shadow-glass);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    padding: 24px;
    z-index: 10;
    overflow: hidden;
}

/* Logo Area */
.logo-area {
    margin-bottom: 12px; /* Kısaltıldı */
}

.logo-area h2 {
    font-family: 'Outfit', sans-serif;
    color: var(--dark);
    font-size: 1.4rem; /* Biraz ufaltıldı */
    font-weight: 800;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-area h2 i {
    color: var(--primary);
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.owner-text {
    font-family: 'Inter', sans-serif; /* Plaka & Maliyet ile aynı font */
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-left: 2px;
    color: var(--accent); /* mdfkesiM sonundaki turkuaz/açık mavi renk */
    opacity: 0.95; 
    transform: translateY(4px); /* Optik olarak alt çizgiye hizalama */
}

.badge {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-text-fill-color: white;
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 4px 10px; /* Slightly more padding for better look */
    border-radius: 20px;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.3);
    transform: translateY(-2px); /* Fix vertical alignment */
}

/* Minimal Toolbar */
.toolbar {
    display: flex;
    gap: 6px;
    margin-bottom: 16px; /* Kısaltıldı */
    background: rgba(255, 255, 255, 0.9);
    padding: 8px; /* Kısaltıldı */
    border-radius: var(--radius-md);
    border: 2px solid rgba(79, 70, 229, 0.4); /* Belirgin çerçeve (kontür) */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05); /* Derinlik */
}

.toolbar button,
.btn-icon {
    flex: 1;
    padding: 8px; /* Kısaltıldı */
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: center;
    color: var(--text-muted);
    font-size: 1.1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative; /* Tooltip için */
}

/* CSS Tooltip Yapısı */
[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark);
    color: white;
    padding: 4px 8px;
    font-size: 0.75rem;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 100;
    pointer-events: none;
    font-family: 'Inter', sans-serif;
}

.toolbar button:hover,
.btn-icon:hover {
    background: white;
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* Sections */
.panel-section {
    margin-bottom: 16px; /* Kısaltıldı */
    padding-bottom: 12px; /* Kısaltıldı */
    border-bottom: 1px solid var(--border-light);
}

.panel-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.panel-section h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem; /* Küçültüldü */
    color: var(--dark);
    margin-bottom: 14px; /* Başlık ile içerik arasına biraz daha nefes payı bırakıldı */
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-section h3 i {
    color: var(--primary);
    font-size: 1rem;
    opacity: 0.8;
}
/* Modal / Pop-up Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    margin: 5% auto;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

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

.close-modal {
    color: var(--text-muted);
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--danger);
    text-decoration: none;
}

.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.input-group-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}

.input-group-col label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
}

.input-group-col input, .input-group-col select {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 10px;
    border: 1px solid rgba(79, 70, 229, 0.3);
    border-radius: 6px;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s;
}

.input-group-col input:focus, .input-group-col select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* Modern Input Fields */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.cost-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-top: 15px;
    margin-bottom: 15px;
}

.cost-grid label {
    display: block;
    font-size: 0.75rem;
    color: var(--primary);
    margin-bottom: 4px;
    font-weight: 600;
}

.cost-grid input {
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(79, 70, 229, 0.4);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.cost-grid input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    background: white;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

label {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: block;
}

.input-group input,
.input-group select,
.settings-grid input {
    width: 100%;
    padding: 8px 10px; /* Daha kompakt */
    border: 1px solid rgba(79, 70, 229, 0.4); /* İnce mavi çizgi eklendi */
    background: rgba(255,255,255,0.7);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--dark);
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
}

.input-group input:focus,
.input-group select:focus,
.settings-grid input:focus {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
    outline: none;
}

/* --- MODERN PART LIST --- */
.panel-section.flex-grow {
    flex-grow: 1;
    border: none;
    display: flex;
    flex-direction: column;
    min-height: 0; /* for flex shrinking */
}

.parts-header {
    display: grid;
    grid-template-columns: 2fr 1.2fr 1.2fr 0.8fr 30px 32px 30px;
    gap: 4px;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 10px;
    padding: 0 5px;
}

#parts-list {
    overflow-y: auto;
    flex-grow: 1;
    margin-bottom: 16px;
    padding-right: 5px;
}

/* Custom Scrollbar for parts list */
#parts-list::-webkit-scrollbar {
    width: 6px;
}
#parts-list::-webkit-scrollbar-track {
    background: transparent;
}
#parts-list::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.3);
    border-radius: 10px;
}
#parts-list::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.5);
}

.part-row {
    display: grid;
    grid-template-columns: 2fr 1.2fr 1.2fr 0.8fr 30px 32px 30px;
    gap: 4px;
    align-items: center;
    background: rgba(255, 255, 255, 0.7);
    padding: 8px 10px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(79, 70, 229, 0.3); /* İnce mavi çizgi */
    transition: all 0.2s ease;
    position: relative;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.part-row:hover {
    background: white;
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.part-row input[type="text"],
.part-row input[type="number"] {
    width: 100%;
    min-width: 0; /* Inputların Grid içinde sıkışıp taşmasını engeller */
    padding: 6px 4px;
    border: none;
    background: transparent;
    border-bottom: 2px solid rgba(226, 232, 240, 0.8);
    border-radius: 0;
    font-size: 0.9rem;
    color: var(--dark);
    font-weight: 600;
    transition: 0.2s;
}

/* Sayı girişlerindeki gereksiz okları (spinner) gizleyelim ki yer açılsın */
input[type="number"]::-webkit-inner-spin-button, 
input[type="number"]::-webkit-outer-spin-button { 
    -webkit-appearance: none; 
    margin: 0; 
}
input[type="number"] {
    -moz-appearance: textfield;
}

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

/* Checkboxes and Icons */
.banding-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    width: 26px;
    height: 26px;
    margin: 0 auto;
}

.banding-chk {
    appearance: none;
    width: 11px;
    height: 11px;
    border: 1.5px solid var(--text-muted);
    border-radius: 3px;
    cursor: pointer;
    transition: 0.2s;
    background: rgba(255,255,255,0.5);
}

.banding-chk:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.rotate-chk {
    appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid var(--text-muted);
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255,255,255,0.5);
}

.rotate-chk:checked {
    background: var(--dark);
    border-color: var(--dark);
    transform: rotate(180deg);
}

.rotate-chk:checked::after {
    content: '\f021';
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    color: white;
    font-size: 11px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.btn-del {
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 6px;
    border-radius: 50%;
    transition: 0.2s;
    opacity: 0.5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.part-row:hover .btn-del {
    opacity: 1;
}

.btn-del:hover {
    color: var(--danger);
    background: #fee2e2;
    transform: scale(1.1);
}

/* --- MODERN BUTTONS --- */
.action-area {
    margin-top: auto;
}

.btn-primary,
.btn-danger,
.btn-warning,
.btn-secondary {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: var(--radius-md);
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(79, 70, 229, 0.39);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: white;
    color: var(--dark);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    margin-top: 10px;
}

.btn-secondary:hover {
    background: var(--bg-app);
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: white;
    padding: 12px;
    font-size: 0.95rem;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(239, 68, 68, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning) 0%, #d97706 100%);
    color: white;
    padding: 12px;
    font-size: 0.95rem;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(245, 158, 11, 0.4);
}

/* --- MAIN CONTENT & CARDS --- */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 12px;
    background: var(--bg-panel);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: var(--shadow-glass);
    overflow: hidden;
}

/* Enhanced Stats Bar */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stat-item {
    background: white;
    padding: 15px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Farklı renklerde kart tasarımları */
.stat-item:nth-child(1) {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    border: 1px solid #a5b4fc;
}
.stat-item:nth-child(1) .stat-icon { color: #a5b4fc; }
.stat-item:nth-child(1) span, .stat-item:nth-child(1) strong { color: #3730a3; }

.stat-item:nth-child(2) {
    background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%);
    border: 1px solid #fdba74;
}
.stat-item:nth-child(2) .stat-icon { color: #fdba74; }
.stat-item:nth-child(2) span, .stat-item:nth-child(2) strong { color: #9a3412; }

.stat-item:nth-child(3) {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    border: 1px solid #86efac;
}
.stat-item:nth-child(3) .stat-icon { color: #86efac; }
.stat-item:nth-child(3) span, .stat-item:nth-child(3) strong { color: #166534; }

.stat-item:nth-child(4) {
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
    border: 1px solid #d8b4fe;
}
.stat-item:nth-child(4) .stat-icon { color: #d8b4fe; }
.stat-item:nth-child(4) span, .stat-item:nth-child(4) strong { color: #6b21a8; }

.stat-item:nth-child(5) {
    background: linear-gradient(135deg, #ccfbf1 0%, #99f6e4 100%);
    border: 1px solid #5eead4;
}
.stat-item:nth-child(5) .stat-icon { color: #5eead4; }
.stat-item:nth-child(5) span, .stat-item:nth-child(5) strong { color: #0f766e; }

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Adding icons to stat items via HTML */
.stat-item .stat-icon {
    position: absolute;
    right: -10px;
    bottom: -15px;
    font-size: 5rem;
    opacity: 0.4;
    z-index: 0;
    transition: 0.3s;
}

.stat-item:hover .stat-icon {
    transform: scale(1.1) rotate(-5deg);
}

.stat-item span {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 1;
    margin-bottom: 4px;
}

.stat-item strong {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    color: var(--dark);
    font-weight: 800;
    z-index: 1;
}

.stat-item strong.highlight {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Canvas Area */
.canvas-wrapper {
    flex: 1;
    background: white;
    border-radius: var(--radius-lg);
    overflow: auto;
    display: flex;
    align-items: center;
    padding: 30px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.02);
    border: 1px solid var(--border-light);
    background-image: radial-gradient(rgba(100, 116, 139, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Custom Scrollbar for canvas */
.canvas-wrapper::-webkit-scrollbar {
    height: 10px;
    width: 10px;
}
.canvas-wrapper::-webkit-scrollbar-track {
    background: #f8fafc;
    border-radius: var(--radius-md);
}
.canvas-wrapper::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: var(--radius-md);
    border: 2px solid #f8fafc;
}
.canvas-wrapper::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Offcuts Panel */
.offcuts-panel {
    min-height: 140px;
    margin-top: 20px;
    background: white;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.offcuts-panel h4 {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    color: var(--dark);
    margin-bottom: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.offcuts-panel h4 i {
    color: var(--success);
}

.offcuts-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    overflow-y: auto;
}

.offcut-tag {
    background: var(--success-light);
    color: #065f46;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid #a7f3d0;
    transition: 0.2s;
    cursor: default;
}

.offcut-tag:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    background: #a7f3d0;
}

/* --- RESPONSIVE MOBILE APP FEEL --- */
@media (max-width: 850px) {
    body {
        overflow-y: auto;
    }
    .app-container {
        flex-direction: column;
        height: auto;
        overflow: visible;
        padding: 0;
        gap: 0;
    }
    
    .sidebar {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        border-radius: 0;
        border: none;
        border-bottom: 1px solid var(--border-light);
        box-shadow: none;
    }
    
    .main-content {
        border-radius: 0;
        border: none;
        box-shadow: none;
        background: var(--bg-app);
    }
    
    .stats-bar {
        grid-template-columns: 1fr 1fr;
    }

    #parts-list {
        overflow-x: auto;
        padding-bottom: 10px;
    }
    
    /* Mobilde girdi alanlarının ezilmesini önlemek için yatay kaydırmaya zorlar ama ekrana tam sığacak ölçüye çeker */
    .parts-header, .part-row {
        min-width: 340px; 
    }
}

/* 3D Visualizer Modal Layout */
.modal-content-large {
    max-width: 100% !important;
    width: 100% !important;
    min-height: 100vh !important;
    margin: 0 !important;
    border-radius: 0 !important;
    border: none !important;
    background: #ffffff !important;
}

.modal-layout {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

@media (min-width: 768px) {
    .modal-layout {
        flex-direction: row;
    }
    .modal-form-side {
        flex: 1;
        max-width: 50%;
    }
    .modal-3d-side {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 80vh;
    }
}

#module-3d-container {
    flex-grow: 1;
    min-height: 400px;
    height: 100%;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-light);
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.05);
}

.viewer-hint {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 10px;
}

/* Section Card Styles */
.section-card {
    background: #f8fafc;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 10px 15px;
    position: relative;
}

.section-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary);
    border-bottom: 1px solid rgba(79, 70, 229, 0.1);
    padding-bottom: 8px;
}

.btn-remove-section {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 5px;
    transition: 0.2s;
}
.btn-remove-section:hover {
    color: #b91c1c;
    transform: scale(1.1);
}

/* Toast Notification Styles */
.toast-msg {
    visibility: hidden;
    min-width: 250px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 8px;
    padding: 16px;
    position: fixed;
    z-index: 10000;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%) translateY(20px);
    font-size: 1rem;
    box-shadow: 0px 4px 15px rgba(0,0,0,0.2);
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
    font-weight: 500;
}

.toast-msg.show {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-success {
    background-color: #2e7d32;
}

.toast-error {
    background-color: #d32f2f;
}

.toast-info {
    background-color: #0277bd;
}

/* Update Toast (PWA) */
.update-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 100000;
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0;
    pointer-events: none;
    background: #0f172a;
    color: white;
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 15px;
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid #334155;
    width: max-content;
    max-width: 90vw;
}

.update-toast.show {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.update-toast .update-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.update-toast i {
    font-size: 24px;
    color: var(--primary);
}

.update-toast strong {
    display: block;
    font-size: 15px;
    margin-bottom: 3px;
}

.update-toast p {
    margin: 0;
    font-size: 13px;
    color: #94a3b8;
}

.update-toast .btn {
    padding: 8px 16px;
    font-size: 14px;
    white-space: nowrap;
}

/* Giriş Ekranı (Login) */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease, visibility 0.3s;
}

.login-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: fadeInScale 0.3s ease-out; /* Daha sakin, ortadan beliren animasyon */
}

@keyframes fadeInScale {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.shake {
    animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-2px, 0, 0); }
    20%, 80% { transform: translate3d(4px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
    40%, 60% { transform: translate3d(6px, 0, 0); }
}

@media (max-width: 768px) {
    .responsive-grid-3 {
        grid-template-columns: 1fr 1fr !important;
    }
}
@media (max-width: 400px) {
    .responsive-grid-3 {
        grid-template-columns: 1fr !important;
    }
}
