/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    min-height: 100vh;
    color: #333;
}

/* Main Wrapper */
.main-wrapper {
    width: 85%;
    margin: 0 auto;
    padding: 0 20px;
}

/* Main Screen Specific */
.main-screen .main-wrapper {
    width: 100vw;
    margin: 0 auto;
}

/* Templates Screen Specific */
#templates-screen .main-wrapper {
    width: 100vw;
    margin: 0 auto;
    padding: 0 20px;
}

@media (max-width: 768px) {
    .main-wrapper {
        width: 95%;
        padding: 0 15px;
    }
    
    .main-screen .main-wrapper {
        width: 100vw;
        padding: 0 15px;
    }
}

/* Container */
.container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

/* Screen Management */
.screen {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1rem 0;
}

.screen.hidden {
    display: none;
}

/* Generic hidden utility */
.hidden {
    display: none !important;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.loading-content p {
    margin-top: 1rem;
    color: #3B82F6;
    font-weight: 600;
    font-size: 16px;
}

/* Response Loading */
.response-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 1rem 0;
}

.response-loading .loading-text {
    color: #3B82F6;
    font-weight: 600;
    font-size: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Cards */
.login-card,
.profile-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    padding: 2rem;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header .logo {
    height: 100px;
    margin-bottom: 1rem;
}

.login-header h1 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: #666;
    font-size: 0.9rem;
}

.login-content h2 {
    text-align: center;
    margin-bottom: 1rem;
    color: #333;
}

.instruction {
    text-align: center;
    color: #666;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

input[type="email"],
input[type="text"],
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

input[type="email"]:focus,
input[type="text"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: #4b9ac7;
    color: white;
}

.btn-primary:hover {
    background: #e25b6b;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #4b9ac7;
    color: white;
}

.btn-secondary:hover {
    background: #e25b6b;
}

.btn-success {
    background: #4b9ac7;
    color: white;
}

/* Generate Buttons Container */
.generate-buttons-container {
    display: flex;
    gap: 0.75rem;
    width: 100%;
}

.generate-buttons-container .btn {
    flex: 1;
    width: 50%;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    background: #4b9ac7;
    color: white;
}

.btn-sm:hover {
    background: #e25b6b;
}

/* Error Messages */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 0.75rem;
    border-radius: 6px;
    margin-top: 1rem;
    border: 1px solid #f5c6cb;
}

.error-message.hidden {
    display: none;
}

/* Main Banner */
.main-banner {
    background: #4b9ac7;
    color: white;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.66rem; /* %33'e düşürüldü */
}

.logo-container {
    background: white;
    border-radius: 12px;
    padding: 5px; /* %33'e düşürüldü */
    margin-right: 100px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.logo {
    height: 50px; /* yaklaşık %33'e düşürüldü */
    filter: brightness(1.1);
}

.banner-text {
    flex: 1;
    text-align: center;
}

.banner-text h1 {
    margin: 0;
    font-size: 2.2rem;
    font-weight: 600;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.banner-text p {
    margin: 0.3rem 0 0 0;
    font-size: 1rem;
    opacity: 0.9;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* User Info Bar - Removed, moved to banner */

/* Navigation Buttons - Now in banner-user-area */

.btn-nav {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-nav:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.btn-nav.active {
    background: rgba(255, 255, 255, 0.9);
    color: #4b9ac7;
    font-weight: 600;
}

.user-info h3 {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 600;
    color: #333;
}

/* User profile styles moved to .user-name and .user-department */

.banner-user-area {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.banner-user-info {
    display: flex;
    align-items: center;
}

.user-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
}

.banner-navigation-buttons {
    display: flex;
    gap: 0.5rem;
    margin-right: 1rem;
    flex-shrink: 0;
    align-self: flex-end;
    margin-bottom: 0.5rem;
}

/* Admin Panel */
.admin-panel {
    margin-bottom: 2rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: white;
}

.admin-panel.hidden {
    display: none;
}

/* Previous Responses Accordions */
.prev-accordion {
    margin-bottom: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: white;
}

.prev-accordion.hidden {
    display: none;
}

/* Previous Accordions */
.previous-accordion {
    margin-bottom: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: white;
}

.previous-accordion.hidden {
    display: none;
}

.previous-accordion .accordion-header {
    padding: 1rem;
    background: #4b9ac7;
    border-bottom: 1px solid #dee2e6;
    cursor: pointer;
    font-weight: 600;
    color: white;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.previous-accordion .accordion-content {
    padding: 1rem;
    display: none;
}

.previous-accordion .accordion-content.active {
    display: block;
}

.previous-accordion .accordion-icon {
    transition: transform 0.3s ease;
}

.previous-accordion .accordion-content.active + .accordion-header .accordion-icon {
    transform: rotate(180deg);
}

.prev-accordion-header {
    padding: 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    cursor: pointer;
    font-weight: 600;
    color: #495057;
    border-radius: 8px 8px 0 0;
}

.prev-accordion-content {
    padding: 1rem;
    display: none;
}

.prev-accordion-content.active {
    display: block;
}

.prev-copy-btn {
    background: #4b9ac7;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.prev-copy-btn:hover {
    background: #e25b6b;
}

.accordion-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    cursor: pointer;
    background: #4b9ac7;
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid #dee2e6;
    color: white;
}

.accordion-header:hover {
    background: #e25b6b;
}

.accordion-header h3 {
    flex: 1;
    font-weight: 600;
    font-size: 1.1rem;
    margin: 0;
}

.accordion-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.accordion-content {
    display: none;
    padding: 1rem;
    border-radius: 0 0 8px 8px;
}

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

/* Main App Area */
.main-app-area {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    width: 100%;
    max-width: none;
}

/* App Layout */
.app-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .app-layout {
        grid-template-columns: 1fr;
    }
}

/* Left Column */
.left-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Request Sections */
.request-section {
    background: #f8f9fa;
    padding: 0.1rem;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.request-section h3 {
    margin: 0 0 1rem 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 600;
    color: #333;
    font-size: 1.1rem;
}

.section-label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.request-section textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.5;
    resize: vertical;
    box-sizing: border-box;
}

.request-section textarea:focus {
    outline: none;
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Settings Accordion */
.settings-accordion {
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    overflow: hidden;
}

.settings-grid {
    display: grid;
    gap: 1rem;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.setting-item label {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.setting-item select,
.setting-item input[type="range"] {
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-family: inherit;
}

.setting-item input[type="range"] {
    padding: 0;
    border: none; /* Çift görünümü engelle */
    background: transparent; /* İç/dış izlenimini kaldır */
}

.setting-item span {
    font-size: 0.8rem;
    color: #666;
    text-align: center;
}

/* Generate Button */
#generate-btn {
    width: 100%;
    background: #4b9ac7;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(75, 154, 199, 0.3);
}

#generate-btn:hover {
    background: #e25b6b;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(226, 91, 107, 0.4);
}

#generate-btn:active {
    transform: translateY(0);
}

/* Right Column */
.right-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Response Section */
.response-section {
    background: #f8f9fa;
    padding: 0.1rem;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.response-section label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.response-area {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 1rem;
    min-height: 200px;
    background: white;
    margin-bottom: 1rem;
}

.response-content {
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #333;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.response-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Previous Responses */
.previous-responses {
    background: #f8f9fa;
    padding: 0.1rem;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.previous-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.previous-response {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    overflow: hidden;
    background: white;
}

.response-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    cursor: pointer;
    border-bottom: 1px solid #dee2e6;
}

.response-header:hover {
    background: #e9ecef;
}

.response-title {
    flex: 1;
    font-weight: 600;
    color: #333;
}

.response-date {
    font-size: 0.8rem;
    color: #666;
    margin-right: 0.5rem;
}

.response-toggle {
    font-size: 0.8rem;
    color: #666;
}

.response-content {
    padding: 1rem;
    background: white;
}

.response-section {
    margin-bottom: 1rem;
}

.response-section label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.response-text {
    background: #f8f9fa;
    padding: 0.75rem;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .banner-content {
        flex-direction: column;
        text-align: center;
    }
    
    .logo-container {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
    
    .logo {
        height: 33px; /* mobilde %33 */
    }
    
    .banner-navigation-buttons {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
    
    .banner-navigation-buttons .btn {
        width: 100%;
    }
    
    .banner-text h1 {
        font-size: 1.8rem;
    }
    
    .banner-user-area {
        flex-direction: column;
        gap: 0.75rem;
        margin-top: 0.5rem;
        width: 100%;
        align-items: stretch;
    }
    
    
    .banner-user-area .btn-secondary {
        width: 100%;
    }
    
    .response-actions {
        flex-direction: column;
    }
    
    .main-app-area {
        padding: 1rem;
    }
}

/* Previous Responses */
.previous-responses {
    margin-top: 2rem;
}

.previous-list {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
}

.no-responses {
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 1rem;
}

/* Previous Accordions */
.previous-accordions {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 100%;
    overflow: hidden;
}

.previous-accordion {
    border-bottom: 1px solid #eee;
}

.previous-accordion:last-child {
    border-bottom: none;
}

.previous-accordion .accordion-header {
    background: #4b9ac7;
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    transition: background-color 0.2s;
    color: white;
}

.previous-accordion .accordion-header:hover {
    background: #e25b6b;
}

.previous-accordion .accordion-title {
    color: white;
}

.previous-accordion .accordion-icon {
    color: #666;
    transition: transform 0.2s;
}

.previous-accordion .accordion-content {
    padding: 16px;
    background: white;
    width: 100%;
    overflow: hidden;
}

.previous-accordion .accordion-content.hidden {
    display: none;
}

.previous-accordion .accordion-content:not(.hidden) {
    display: block;
}

.previous-accordion .accordion-content.open .accordion-icon {
    transform: rotate(180deg);
}

#main-response {
    width: 100%;
    padding: 0; /* textarea kendi paddings */
    border: none; /* container görünmez olsun */
    background: transparent;
    white-space: normal;
    overflow: visible; /* çift kaydırmayı engelle */
}

/* Hide developer tools labels and clean up prev-text divs */
div[id*="prev-text-"] {
    position: relative;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
}

div[id*="prev-text-"]::before,
div[id*="prev-text-"]::after {
    display: none !important;
    content: none !important;
}

/* Response textarea styles */
.response-textarea {
    width: 100%;
    height: 300px;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-y: auto;
    resize: vertical;
    margin: 0;
    display: block;
}

.response-textarea:hover {
    border-color: #3B82F6;
    background: #f0f9ff;
}

.response-textarea:focus {
    outline: none;
    border-color: #3B82F6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

/* Spinner Animation - Sadece metin göster */
.spinner {
    display: none;
}

/* ============================================================================
   TEMPLATES SCREEN STYLES
   ============================================================================ */

/* Templates Content */
.templates-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    width: 100%;
    max-width: none;
}

/* Templates Layout */
.templates-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Sol Panel - Filtreler */
.templates-filters {
    background: white;
    border-radius: 12px;
    padding: 0.1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    height: fit-content;
    position: sticky;
    top: 2rem;
}

.filters-header h3 {
    margin: 0 0 1.5rem 0;
    color: #1f2937;
    font-size: 1.2rem;
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.filter-select,
.filter-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Checkbox Styling */
.checkbox-label {
    display: flex !important;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    color: #374151;
}

.filter-checkbox {
    margin-right: 0.75rem;
    width: 18px;
    height: 18px;
    accent-color: #3b82f6;
}

/* Department Info */
.department-info {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: #e0f2fe;
    border-radius: 6px;
    border-left: 3px solid #0284c7;
}

.department-info small {
    color: #0369a1;
    font-weight: 500;
}

/* Sağ Panel - Liste */
.templates-main {
    background: white;
    border-radius: 12px;
    padding: 0.1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.templates-header h3 {
    margin: 0;
    color: #1f2937;
    font-size: 1.3rem;
}

.templates-actions {
    display: flex;
    gap: 0.5rem;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 3rem;
    color: #6b7280;
}

.loading-spinner {
    font-size: 2rem;
    margin-bottom: 1rem;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin: 2rem 0;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.empty-state h2 {
    color: #374151;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.empty-state p {
    color: #6b7280;
    margin-bottom: 2rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Templates List */
.templates-list {
    display: grid;
    gap: 1.5rem;
    margin-top: 2rem;
}

/* Template Card */
.template-card {
    background: white;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    position: relative;
    display: grid;
    grid-template-columns: 80px 1fr auto;
    align-items: center;
    gap: 1rem;
}

.template-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.template-header { display: none; }

.template-id-column {
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    background: #f3f4f6;
    padding: 0.375rem 0.5rem;
    border-radius: 6px;
    text-align: center;
    flex-shrink: 0;
    white-space: nowrap;
}

.template-sms-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #059669;
    background: #d1fae5;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    margin-top: 0.25rem;
    display: inline-block;
}

.template-category {
    display: inline-block;
    background: #e0e7ff;
    color: #3730a3;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    margin-right: 0.5rem;
}

.department-badge {
    display: inline-block;
    background: #fef3c7;
    color: #92400e;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    border: 1px solid #f59e0b;
}

.template-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.template-content { display: none; }

.template-snippet {
    flex: 1;
    color: #374151;
    font-size: 0.95rem;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.template-meta { display: none; }

.template-owner {
    font-weight: 500;
}

.template-date {
    font-size: 0.8rem;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none; /* default hidden; only .show ile görünür */
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1rem;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal.show { 
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 0;
    max-width: 600px;
    width: 100%;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.05);
    margin: 1rem;
    animation: slideUp 0.3s ease-out;
    position: relative;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 16px 16px 0 0;
}

.modal-header h3 {
    margin: 0;
    color: #1f2937;
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    padding: 0.25rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #e5e7eb;
    color: #111827;
}

.modal-body {
    padding: 1.5rem;
}

.use-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.use-options .btn {
    width: 100%;
    text-align: left;
    justify-content: flex-start;
}

.delete-warning {
    color: #dc2626;
    font-weight: 500;
    margin-top: 0.5rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.btn-danger {
    background: #dc2626;
    color: white;
    border: none;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-danger:disabled {
    background: #9ca3af;
    border-color: #9ca3af;
    cursor: not-allowed;
}

.btn-spinner {
    display: inline-block;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Error State */
.error-state {
    text-align: center;
    padding: 3rem 2rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    margin: 2rem 0;
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.error-state h3 {
    color: #dc2626;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.error-state p {
    color: #7f1d1d;
    margin-bottom: 1.5rem;
}

.retry-btn {
    background: #dc2626;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.retry-btn:hover {
    background: #b91c1c;
}

/* ============================================================================
   TEMPLATE SAVE SECTION STYLES
   ============================================================================ */

/* Template Save Section */
.save-template-section {
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.template-save-header {
    margin-bottom: 1rem;
}

.template-checkbox {
    margin-right: 0.5rem;
    width: 18px;
    height: 18px;
    accent-color: #3b82f6;
}

/* Category Selection */
.template-category-section {
    border-top: 1px solid #e5e7eb;
    padding-top: 1rem;
}

.category-selection {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.category-dropdown-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.category-dropdown-group label {
    font-weight: 500;
    color: #374151;
    font-size: 0.9rem;
}

.category-select {
    padding: 0.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
    transition: border-color 0.3s ease;
}

.category-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.new-category-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.new-category-input {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.category-input {
    flex: 1;
    min-width: 200px;
    padding: 0.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.category-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Toast Notification Styles */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: white;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #10b981;
    min-width: 300px;
    max-width: 400px;
    animation: slideInRight 0.3s ease-out;
    position: relative;
    overflow: hidden;
}

.toast.error {
    border-left-color: #ef4444;
}

.toast.warning {
    border-left-color: #f59e0b;
}

.toast.info {
    border-left-color: #3b82f6;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toast-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.4;
    color: #374151;
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    background: #f3f4f6;
    color: #374151;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast.hiding {
    animation: slideOutRight 0.3s ease-in forwards;
}

/* Responsive Design for Template Save */
@media (max-width: 768px) {
    .category-selection {
        gap: 0.75rem;
    }
    
    .new-category-input {
        flex-direction: column;
        align-items: stretch;
    }
    
    .category-input {
        min-width: auto;
    }
    
    .toast-container {
        left: 20px;
        right: 20px;
        top: 10px;
    }
    
    .toast {
        min-width: auto;
        max-width: none;
    }
}

/* Responsive Design for Templates */
@media (max-width: 768px) {
    .templates-content {
        padding: 1rem;
    }
    
    .templates-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0;
    }
    
    #templates-screen .main-wrapper {
        padding: 0 15px;
    }
    
    .templates-filters {
        position: static;
        order: 2;
    }
    
    .templates-main {
        order: 1;
    }
    
    .empty-state {
        padding: 2rem 1rem;
        margin: 1rem 0;
    }
    
    .empty-state-icon {
        font-size: 3rem;
    }
    
    .empty-state h2 {
        font-size: 1.3rem;
    }
    
    .template-card {
        grid-template-columns: 60px 1fr auto;
        padding: 0.5rem 0.75rem;
        gap: 0.75rem;
    }
    
    .template-id-column {
        font-size: 0.75rem;
        padding: 0.25rem 0.375rem;
    }
    
    .template-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .template-header {
        display: none;
    }
    
    .modal-content {
        width: calc(100% - 2rem);
        margin: 0.5rem;
        max-height: calc(100vh - 1rem);
    }
    
    .modal {
        padding: 0.5rem;
    }
    
    .use-options .btn {
        font-size: 0.9rem;
        padding: 0.75rem;
    }
}

/* ============================================================================
   LOAD MORE & PAGINATION STYLES
   ============================================================================ */

/* Load More Section */
.load-more-section {
    text-align: center;
    margin-top: 2rem;
    padding: 1rem;
}

.load-more-btn {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.load-more-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.load-more-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    color: #6b7280;
}

.load-more-spinner .loading-spinner {
    font-size: 1.5rem;
}

.load-more-spinner p {
    margin: 0;
    font-size: 0.9rem;
}

/* Skeleton Loading Cards */
.skeleton-card {
    background: white;
    border-radius: 12px;
    padding: 0.1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    margin-bottom: 1.5rem;
}

.skeleton-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.skeleton-title {
    height: 1.5rem;
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
    width: 60%;
}

.skeleton-category {
    height: 1.2rem;
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 12px;
    width: 30%;
    margin-bottom: 0.5rem;
}

.skeleton-content {
    height: 4rem;
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.skeleton-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f3f4f6;
    padding-top: 1rem;
}

.skeleton-owner {
    height: 1rem;
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
    width: 40%;
}

.skeleton-date {
    height: 1rem;
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
    width: 30%;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.spinner:not(.hidden) {
    display: inline-block;
}


/* Error Message */
.error-message {
    background-color: #FEE2E2;
    border: 1px solid #FECACA;
    color: #DC2626;
    padding: 8px 12px;
    border-radius: 6px;
    margin-top: 8px;
    font-size: 14px;
    animation: slideIn 0.3s ease-out;
}

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