/* Demo mode styles for ScribbleScan - Matching consistent design system */

.demo-file-picker {
    display: none;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 35px;
    padding: 20px;
    margin: 15px 0;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    width: 90%;
    max-width: none;
}

.demo-file-picker.active {
    display: block;
}

.demo-header {
    background: var(--primary-color);
    padding: 15px 20px;
    border-radius: 15px;
    margin: 0 0 20px 0;
    text-align: center;
}

.demo-header h3 {
    color: #fff;
    margin: 0 0 8px 0;
    font-size: 1.6rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    letter-spacing: 0.5px;
}

.demo-header h4 {
    color: #fff;
    margin: 0 0 8px 0;
    font-size: 1rem;
    font-weight: 500;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    letter-spacing: 0.5px;
}

.demo-header p {
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
    font-size: 1rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.demo-files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin: 20px auto;
    padding: 0 5px;
    justify-content: center;
    max-width: 1600px;
    width: 100%;
}

/* Override any conflicting media queries */
@media (max-width: 685px) {
    .demo-files-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
    }
}

@media (max-width: 480px) {
    .demo-files-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Remove all device-specific media queries for .demo-files-grid and tile sizing */

.demo-file-card {
    background: rgba(255, 255, 255, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.7) !important;
    border-radius: 20px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box; /* Ensure padding and border are within the width */
}

.demo-file-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.6s;
}

.demo-file-card:hover::before {
    left: 100%;
}

.demo-file-card:hover {
    border-color: var(--primary-color) !important;
    background: #DDD !important;
    transform: scale(1.02);
    box-shadow: 0 3px 12px rgba(0,0,0,0.15);
}

.demo-file-card.selected {
    border-color: var(--primary-color) !important;
    background: #DDD !important;
    transform: scale(1.02);
    box-shadow: 0 3px 12px rgba(74, 144, 226, 0.3);
}

.demo-file-card.selected::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px solid var(--primary-color);
    border-radius: 22px;
    pointer-events: none;
}

.demo-file-thumbnail {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.demo-file-card:hover .demo-file-thumbnail {
    transform: scale(1.02);
}

.demo-file-info h4 {
    font-weight: 600;
    color: #333 !important;
    margin-bottom: 4px;
    font-size: 0.9rem;
    text-shadow: none;
}

.demo-file-info p {
    color: #666 !important;
    font-size: 0.8rem;
    line-height: 1.3;
    margin: 0;
    text-shadow: none;
}

.demo-file-card .selection-indicator {
    display: none;
    color: #4a90e2;
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 8px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.demo-file-card.selected .selection-indicator {
    display: block;
}

.demo-preview {
    display: none;
    margin-top: 16px;
    padding: 16px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.demo-preview.active {
    display: block;
}

.demo-preview-image {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.demo-selection-status {
    margin-top: 20px;
    padding: 12px 20px;
    background: var(--primary-color);
    border: 1px solid var(--primary-color-dark);
    border-radius: 8px;
    color: #fff;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.demo-select-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.demo-select-all,
.demo-clear-all {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    min-width: 120px;
    position: relative;
    overflow: hidden;
}

.demo-select-all:hover,
.demo-clear-all:hover {
    background: var(--primary-color-dark);
    transform: scale(1.05);
}

.demo-clear-all {
    background: #6c757d;
}

.demo-clear-all:hover {
    background: #495057;
}

/* --- DEMO SIGN-IN BANNER --- */
.demo-sign-in-banner {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    background: #fff;
    border: 1.5px solid #e3e8f0;
    box-shadow: 0 4px 24px 0 rgba(0,0,0,0.10), 0 1.5px 0 #e3e8f0;
    border-radius: 22px;
    padding: 0.7rem 2.2rem 0.7rem 2.2rem;
    min-width: 420px;
    max-width: 700px;
    width: 90vw;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s, top 0.3s;
    opacity: 1;
    font-size: 1.08rem;
}

.demo-sign-in-banner.hiding {
    opacity: 0;
    pointer-events: none;
    top: 0;
}

.banner-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-align: center;
    gap: 0.2rem;
}

.banner-icon {
    color: var(--primary-color, #1976d2);
    font-size: 1.35rem;
    margin-right: 2px;
}

.banner-main-text {
    color: #222;
    font-weight: 600;
    font-size: 1.08rem;
    margin-bottom: 0.1rem;
}

.banner-sub-text {
    color: #444;
    font-size: 1.02rem;
    margin-top: 0.1rem;
}

.demo-banner-signin-btn {
    background: #2563eb;
    color: #fff !important;
    border: none;
    border-radius: 18px;
    padding: 0.45em 1.5em;
    font-size: 1.04rem;
    font-weight: 600;
    margin: 0.4em 0 0.2em 0;
    box-shadow: 0 2px 8px 0 rgba(37,99,235,0.08);
    transition: background 0.18s;
    cursor: pointer;
    outline: none;
    text-align: center;
    display: inline-block;
}

.demo-banner-signin-btn:hover {
    background: #1746b3;
}

.banner-close-btn {
    position: absolute;
    top: 10px;
    right: 14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f3f6fa;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2563eb;
    font-size: 1.18rem;
    cursor: pointer;
    transition: background 0.18s;
    box-shadow: 0 1px 4px 0 rgba(37,99,235,0.06);
}

.banner-close-btn:hover {
    background: #e0e7ff;
}

@media (max-width: 600px) {
    .demo-sign-in-banner {
        min-width: 0;
        max-width: 98vw;
        width: 98vw;
        padding: 0.6rem 0.5rem 0.6rem 0.5rem;
    }
    .banner-close-btn {
        top: 6px;
        right: 6px;
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }
    .banner-main-text, .banner-sub-text {
        font-size: 0.98rem;
    }
    .demo-banner-signin-btn {
        font-size: 0.98rem;
        padding: 0.38em 1.1em;
    }
}

/* Integration with upload mode */
.upload-container.demo-mode .drop-zone-indicator {
    display: none;
}

.upload-container.demo-mode .file-input-container {
    display: none;
}

.upload-container.demo-mode .page-count-container {
    display: none;
}

body.demo-mode #agreementNotice {
    display: none !important;
}

/* Responsive design */
@media (max-width: 768px) {
    .demo-file-picker {
        padding: 15px;
        margin: 10px 0;
        border-radius: 25px;
    }
    
    .demo-header {
        padding: 12px 15px;
        border-radius: 12px;
        margin: 0 0 15px 0;
    }
    
    .demo-files-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
        gap: 10px;
        margin: 15px 0;
        padding: 0;
    }
    
    .demo-file-card {
        padding: 12px;
        border-radius: 10px;
    }
    
    .demo-file-card.selected::after {
        border-radius: 12px;
        top: -1px;
        left: -1px;
        right: -1px;
        bottom: -1px;
    }
    
    .demo-file-thumbnail {
        height: 80px;
        border-radius: 6px;
        margin-bottom: 8px;
    }
    
    .demo-header h3 {
        font-size: 1.3rem;
        margin-bottom: 6px;
    }
    
    .demo-header p {
        font-size: 0.9rem;
    }
    
    .demo-file-info h4 {
        font-size: 0.8rem;
        margin-bottom: 3px;
    }
    
    .demo-file-info p {
        font-size: 0.7rem;
    }
    
    .demo-selection-status {
        margin-top: 15px;
        padding: 10px 15px;
        font-size: 0.9rem;
        border-radius: 20px;
    }
    
    .demo-select-buttons {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        margin-top: 15px;
    }
    
    .demo-select-all,
    .demo-clear-all {
        width: 100%;
        max-width: 200px;
        padding: 12px 20px;
        font-size: 0.85rem;
        border-radius: 20px;
    }
}

@media (max-width: 480px) {
    .demo-files-grid {
        grid-template-columns: 1fr !important;
        max-width: 100%;
    }
    
    .demo-file-card {
        padding: 10px;
        border-radius: 8px;
    }
    
    .demo-file-card.selected::after {
        border-radius: 10px;
    }
    
    .demo-file-thumbnail {
        height: 70px;
    }
    
    .demo-header {
        padding: 10px 12px;
        border-radius: 10px;
    }
    
    .demo-header h3 {
        font-size: 1rem;
    }
    
    .demo-header h4 {
        font-size: 0.7rem;
    }
}

/* Animations */
@keyframes demo-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes demo-card-select {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.demo-file-card.selected {
    animation: demo-card-select 0.3s ease;
}
