/* =============================================== */
/* DEMO.CSS - GÜNCELLENMİŞ VE TEMİZLENMİŞ VERSİYON */
/* Demo butonu ve popup stilleri */
/* =============================================== */

/* =============================================== */
/* DEMO BUTON TEMEL STİLLERİ */
/* =============================================== */

.demo-button {
    background: linear-gradient(135deg, #ff6b6b 0%, #feca57 100%);
    color: white !important;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
    animation: demoPulse 2s infinite;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    z-index: 100;
    margin: 0;
    line-height: 1;
}

.demo-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
    animation: none;
}

.demo-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.demo-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.demo-button:hover::after {
    left: 100%;
}

@keyframes demoPulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
    }
    50% { 
        transform: scale(1.02);
        box-shadow: 0 4px 16px rgba(255, 107, 107, 0.4);
    }
}

/* Giriş yapmış kullanıcı için buton gizle */
body.user-logged-in .demo-button,
.demo-button[style*="display: none"] {
    display: none !important;
}

/* =============================================== */
/* MASAÜSTÜ DÜZEN (1024px ve üzeri) */
/* =============================================== */

@media (min-width: 1025px) {
    .desktop-menu {
        display: flex;
        align-items: center;
        gap: 1.5rem;
    }
    
    /* DEMO BUTONU - desktop-menu içinde, normal sırada */
    .desktop-menu .demo-button {
        margin: 0 10px;
        order: 0;
    }
    
    /* User dropdown en sağda */
    .desktop-menu .user-dropdown-container {
        margin-left: auto;
    }
}

/* =============================================== */
/* TABLET DÜZEN (769px - 1024px) */
/* =============================================== */

@media (min-width: 769px) and (max-width: 1024px) {
    .desktop-menu {
        display: flex;
        align-items: center;
        gap: 1rem;
    }
    
    .desktop-menu .demo-button {
        margin: 0 8px;
    }
    
    .desktop-menu .user-dropdown-container {
        margin-left: auto;
    }
}

/* =============================================== */
/* MOBİL DÜZEN (768px ve altı) */
/* =============================================== */

@media (max-width: 768px) {
    .desktop-menu {
        display: none !important;
    }
    
    .header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.75rem 1rem;
    }
    
    .logo {
        order: 1;
        flex-shrink: 0;
    }
    
    /* DEMO BUTONU - mobil header'da logo ile hamburger arasında */
    .header .demo-button {
        order: 2;
        margin: 0 8px;
        padding: 6px 12px;
        font-size: 0.8em;
        flex-shrink: 0;
        display: inline-flex !important;
        position: relative;
        z-index: 3001;
    }
    
    .mobile-menu-btn {
        order: 3;
        display: flex !important;
        flex-shrink: 0;
        margin-left: 5px;
        z-index: 3000;
        position: relative;
    }
    
    /* Mobil menü overlay - butonların altında */
    .mobile-overlay-menu {
        z-index: 2999 !important;
    }
    
    /* Mobil menü açıkken demo butonu görünür kalsın */
    .mobile-overlay-menu.active ~ .header .demo-button {
        z-index: 3002;
        pointer-events: auto;
    }
}

/* =============================================== */
/* ÇOK KÜÇÜK MOBİL DÜZEN (480px ve altı) */
/* =============================================== */

@media (max-width: 480px) {
    .header .demo-button {
        padding: 5px 10px;
        font-size: 0.75em;
        margin: 0 5px;
    }
    
    .header .demo-button span {
        display: inline; /* Her zaman göster */
    }
}

@media (max-width: 360px) {
    .header .demo-button {
        padding: 4px 8px;
        font-size: 0.7em;
        margin: 0 3px;
    }
}

/* =============================================== */
/* DEMO POPUP STİLLERİ */
/* =============================================== */

.demo-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    padding: 20px;
    animation: demoFadeIn 0.3s ease;
}

.demo-popup-overlay.active {
    display: flex;
}

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

.demo-popup-container {
    background: white;
    border-radius: 16px;
    padding: 0;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: demoSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
}

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

.demo-popup-header {
    padding: 20px 25px 15px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.05), rgba(254, 202, 87, 0.05));
    position: relative;
    min-height: 60px;
}

.demo-popup-header h3 {
    margin: 0;
    font-size: 1.3em;
    color: #333;
    font-weight: 700;
    text-align: center;
    flex: 1;
    padding: 0 40px;
}

.demo-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

.demo-close-btn:hover {
    background: rgba(0,0,0,0.05);
    color: #333;
    transform: translateY(-50%) scale(1.1);
}

.demo-close-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.demo-steps-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    padding: 0 25px;
}

.demo-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    max-width: 120px;
}

.demo-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 70%;
    width: 60%;
    height: 2px;
    background: #e0e0e0;
    z-index: 1;
}

.demo-step.completed:not(:last-child)::after {
    background: #4CAF50;
}

.demo-step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f5f5f5;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 8px;
    z-index: 2;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
}

.demo-step.active .demo-step-circle {
    background: linear-gradient(135deg, #ff6b6b 0%, #feca57 100%);
    color: white;
    border-color: #ff6b6b;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.demo-step.completed .demo-step-circle {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

.demo-step-label {
    font-size: 12px;
    color: #666;
    text-align: center;
    font-weight: 500;
}

.demo-step.active .demo-step-label {
    color: #ff6b6b;
    font-weight: 600;
}

.demo-form-step {
    padding: 0 25px 25px;
    display: none;
}

.demo-form-step.active {
    display: block;
    animation: demoFadeIn 0.3s ease;
}

.demo-step-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    text-align: center;
}

.demo-form-group {
    margin-bottom: 20px;
}

.demo-form-label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
    font-size: 14px;
}

.demo-form-select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 15px;
    color: #333;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    padding-right: 40px;
}

.demo-form-select:hover {
    border-color: #ff6b6b;
}

.demo-form-select:focus {
    outline: none;
    border-color: #ff6b6b;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.demo-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.demo-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #ff6b6b;
    border-radius: 50%;
    animation: demoSpin 1s linear infinite;
    margin: 0 auto 15px;
}

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

.demo-books-list {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 5px;
}

.demo-book-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
}

.demo-book-card:hover {
    transform: translateY(-2px);
    border-color: #ff6b6b;
    box-shadow: 0 6px 12px rgba(255, 107, 107, 0.1);
}

.demo-book-card.selected {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.05);
}

.demo-book-cover {
    width: 60px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.demo-book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ff6b6b 20%, #feca57 100%);
    color: white;
    font-size: 20px;
}

.placeholder-title {
    font-size: 10px;
    margin-top: 5px;
    color: rgba(255,255,255,0.9);
}

.demo-book-info {
    flex: 1;
}

.demo-book-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    line-height: 1.3;
}

.demo-book-author {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.demo-book-meta {
    display: flex;
    gap: 10px;
    font-size: 12px;
    color: #888;
    flex-wrap: wrap;
}

.demo-book-category {
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 12px;
}

.demo-popup-footer {
    padding: 20px 25px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    background: #f8f9fa;
}

.demo-nav-btn {
    padding: 12px 20px;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.demo-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.demo-btn-prev {
    background: white;
    color: #666;
    border: 1px solid #dee2e6;
}

.demo-btn-prev:hover:not(:disabled) {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.demo-btn-next {
    background: linear-gradient(135deg, #ff6b6b 0%, #feca57 100%);
    color: white;
}

.demo-btn-next:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(255, 107, 107, 0.3);
}

.demo-btn-start {
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    color: white;
    flex: 1;
}

.demo-btn-start:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(76, 175, 80, 0.3);
}

.demo-error-message {
    padding: 20px;
    color: #e74c3c;
    text-align: center;
}

/* =============================================== */
/* KOYU MOD DESTEĞİ */
/* =============================================== */

body.dark-mode .demo-popup-container {
    background: #1a1a1a;
    border: 1px solid rgba(255,255,255,0.1);
}

body.dark-mode .demo-popup-header {
    background: rgba(255,255,255,0.05);
    border-bottom-color: rgba(255,255,255,0.1);
}

body.dark-mode .demo-popup-header h3 {
    color: #e0e0e0;
}

body.dark-mode .demo-close-btn {
    color: #aaa;
}

body.dark-mode .demo-close-btn:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

body.dark-mode .demo-step:not(:last-child)::after {
    background: rgba(255,255,255,0.1);
}

body.dark-mode .demo-step-circle {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.7);
}

body.dark-mode .demo-step-label {
    color: rgba(255,255,255,0.7);
}

body.dark-mode .demo-form-select {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.9);
}

body.dark-mode .demo-form-select option {
    background: #2a2a2a;
    color: rgba(255,255,255,0.9);
}

body.dark-mode .demo-book-card {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.1);
}

body.dark-mode .demo-book-title {
    color: rgba(255,255,255,0.9);
}

body.dark-mode .demo-book-author {
    color: rgba(255,255,255,0.7);
}

body.dark-mode .demo-book-category {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.7);
}

body.dark-mode .demo-popup-footer {
    background: rgba(255,255,255,0.05);
    border-top-color: rgba(255,255,255,0.1);
}

body.dark-mode .demo-btn-prev {
    background: #2a2a2a;
    color: #ccc;
    border-color: rgba(255,255,255,0.2);
}

body.dark-mode .demo-btn-prev:hover:not(:disabled) {
    background: #333;
}

/* =============================================== */
/* UTILITY CLASSES */
/* =============================================== */

.demo-fade-in {
    animation: demoFadeIn 0.3s ease;
}

.demo-slide-up {
    animation: demoSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =============================================== */
/* SCROLLBAR STİLLERİ */
/* =============================================== */

.demo-books-list::-webkit-scrollbar {
    width: 6px;
}

.demo-books-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.demo-books-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.demo-books-list::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

body.dark-mode .demo-books-list::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
}

body.dark-mode .demo-books-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
}

body.dark-mode .demo-books-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.3);
}