/* Page and Layout Specific Styles */

/* App Container */
.app {
    width: 100%;
    max-width: 100%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
    border-radius: 14px;
    padding: 1rem;
    box-shadow: 0 10px 30px rgba(2, 6, 23, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    margin: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--card-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
    position: fixed;
    height: 100vh;
    z-index: 100;
    overflow-y: auto;
}

.sidebar h2 {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    padding-left: 0.5rem;
    color: var(--accent);
}

.nav-item {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--muted);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.nav-item.active {
    background: var(--accent);
    color: white;
    font-weight: 600;
}

.main-content {
    flex: 1;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100vh;
    /* Fallback */
    height: 100dvh;
    /* Modern browsers */
    height: calc(var(--vh, 1vh) * 100);
    /* Custom property */
    overflow-y: auto;
    box-sizing: border-box;
}

#task-container {
    width: 100%;
    max-width: 1200px;
    height: auto;
    display: flex;
    flex-direction: column;
}

#task-container .app {
    width: 100%;
    margin: 0;
    box-shadow: none;
    background: transparent;
    border: none;
    backdrop-filter: none;
}

.storage-view {
    margin-top: 3rem;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 100%;
    max-width: 1000px;
}

.storage-view h3 {
    margin-top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    color: var(--muted);
}

pre {
    background: #050a14;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.85rem;
    color: #10b981;
    border: 1px solid var(--border);
    max-height: 400px;
}

/* Task Layout Grids */
.images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 1rem;
    flex: 1;
    min-height: 0;
}

.actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    width: 100%;
    flex-shrink: 0;
    margin-top: 1rem;
}

.actions button {
    min-width: 140px;
}

/* Task Specific Layouts */

/* Labeling */
.labeling-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
    width: 100%;
    flex: 1;
    min-height: 0;
}

.image-preview {
    flex: 1;
    min-height: 0;
    display: flex;
}

.input-section {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.input-group {
    flex-direction: column;
    display: flex;
    gap: 10px;
    align-items: center;
    width: 100%;
}

.input-group input[type=text] {
    flex: 1 1 auto;
    min-width: 220px;
}

.input-group button {
    flex: 0 0 auto;
    min-width: 140px;
}

/* Locator Grid */
.locator-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 16px;
    margin-top: 1em;
    margin-bottom: 1rem;
    flex: 1;
    min-height: 0;
    align-items: start;
}

.locator-grid .imgwrap {
    flex: 0 0 auto;
    width: fit-content;
    max-width: 100%;
    height: auto;
    max-height: none;
    align-self: flex-start;
}

.locator-grid .imgwrap img {
    width: auto;
    height: auto;
    max-width: 100%;
    object-fit: contain;
}

.region-canvas {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 5;
}

.imgwrap.target-wrap {
    touch-action: none;
}

/* Property Identifier */
.property-id-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 1em;
    width: 100%;
    max-width: 100%;
    flex: 1;
    min-height: 0;
}

.property-id-wrapper .imgwrap {
    flex: 1;
    height: 100%;
    max-width: 100%;
    background: none;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    min-height: 0;
}

.property-id-wrapper .actions {
    width: 100%;
    margin-top: 1rem;
    justify-content: center;
}

.property-id-wrapper .imgwrap img {
    display: block;
    width: 100%;
    max-width: 100%;
    border-radius: 12px;
    object-fit: contain;
}

/* Similarity */
.similarity-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    flex-shrink: 0;
}

.similarity-container>button {
    align-self: flex-end;
}

.slider-section {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.slider-label-row {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 14px;
}

.ticks {
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
    margin-top: 8px;
}

.tick {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--muted);
}

.tick span {
    width: 2px;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
}

/* Landing Page */
.landing-page {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    position: relative;
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.landing-hero {
    text-align: center;
    margin-bottom: 3rem;
    animation: slideDown 0.8s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.landing-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(124, 58, 237, 0.1));
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: 20px;
    color: #a78bfa;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1.5rem;
}

.landing-title {
    font-size: clamp(1.75rem, 4vw, 3rem);
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 1rem 0;
    color: var(--text);
}

.gradient-text {
    background: linear-gradient(135deg, #7c3aed 0%, #a78bfa 50%, #c4b5fd 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.landing-subtitle {
    font-size: 1.25rem;
    color: var(--muted);
    margin: 0;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.landing-content {
    width: 100%;
    animation: fadeInUp 1s ease-out 0.3s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.landing-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.landing-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.landing-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #7c3aed, #a78bfa);
    opacity: 0;
    transition: opacity 0.3s ease;
}



.card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.landing-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
    color: var(--text);
}

.landing-card p {
    color: var(--muted);
    line-height: 1.6;
    margin: 0;
    font-size: 0.95rem;
}

.landing-features {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background: rgba(124, 58, 237, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(124, 58, 237, 0.1);
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--muted);
    font-size: 0.95rem;
}

.check-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
    border-radius: 50%;
    color: white;
    font-weight: bold;
    font-size: 0.75rem;
}

.landing-start-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
    margin: 0 auto;
    display: flex;
    position: relative;
    overflow: hidden;
}

.landing-start-btn::before {
    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;
}

.landing-start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.5);
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.landing-start-btn:hover::before {
    left: 100%;
}

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

.btn-arrow {
    font-size: 1.25rem;
    transition: transform 0.3s ease;
}

.landing-start-btn:hover .btn-arrow {
    transform: translateX(4px);
}

/* Landing Page Footer */
.landing-footer {
    width: 100%;
    padding: 2rem 1rem;
    border-top: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
    margin-top: 2rem;
}

.footer-content {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

.footer-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
}

.footer-section h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-section p {
    font-size: 1rem;
    color: var(--text);
    margin: 0;
    font-weight: 500;
}

.footer-link {
    font-size: 1rem;
    color: var(--accent);
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 500;
}

.footer-link:hover {
    color: #a78bfa;
}

.footer-divider {
    width: 1px;
    height: 2rem;
    background: var(--border);
}