﻿/* App shell styles */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-header {
    background: #003366;
    color: white;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

    .app-header h1 {
        margin: 0;
        font-size: 1.2em;
        color: white;
    }

.app-header-buttons {
    display: flex;
    gap: 10px;
}

    .app-header button,
    .app-header-buttons button {
        background: transparent;
        border: 1px solid white;
        color: white;
        padding: 5px 10px;
        border-radius: 4px;
        cursor: pointer;
        font-size: 0.9em;
    }

        .app-header button:hover,
        .app-header-buttons button:hover {
            background: rgba(255,255,255,0.1);
        }

.app-content {
    flex: 1;
    padding: 0;
}

.page-frame {
    width: 100%;
    height: calc(100vh - 50px);
    border: none;
}

/* Home screen styles */
.home-screen {
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

    .home-screen h2 {
        color: #003366;
        border-bottom: 2px solid #003366;
        padding-bottom: 10px;
    }

.action-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.action-btn {
    background: #003366;
    color: white;
    padding: 15px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    cursor: pointer;
    flex: 1;
    min-width: 150px;
}

    .action-btn:hover {
        background: #0055aa;
    }

.inspection-list {
    list-style: none;
    padding: 0;
}

.inspection-item {
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

    .inspection-item:hover {
        border-color: #003366;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }

.inspection-content {
    flex: 1;
    cursor: pointer;
}

.inspection-item h3 {
    margin: 0 0 5px 0;
    color: #003366;
}

.inspection-item p {
    margin: 3px 0;
    color: #666;
    font-size: 0.9em;
}

.inspection-item .status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    margin-top: 5px;
}

.delete-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 1.1em;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

    .delete-btn:hover {
        background: #c82333;
    }

/* Status badges */
.status-draft {
    background: #fff3cd;
    color: #856404;
}

.status-complete {
    background: #d4edda;
    color: #155724;
}

.status-synced {
    background: #cce5ff;
    color: #004085;
}

.status-offline {
    background: #f8d7da;
    color: #721c24;
}

/* Offline indicator */
.offline-indicator {
    background: #f44336;
    color: white;
    padding: 5px 10px;
    text-align: center;
    font-size: 0.9em;
    display: none;
}

    .offline-indicator.visible {
        display: block;
    }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #666;
}

    .empty-state p {
        font-size: 1.1em;
    }

/* Button groups */
.home-buttons {
    display: inline-flex;
    gap: 10px;
}

.form-buttons {
    display: none;
    gap: 10px;
}

/* Install prompt */
.install-prompt {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: #003366;
    color: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 2000;
}

    .install-prompt.visible {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 15px;
    }

    .install-prompt button {
        padding: 8px 16px;
        border-radius: 4px;
        cursor: pointer;
        border: none;
    }

    .install-prompt .install-btn {
        background: white;
        color: #003366;
    }

    .install-prompt .dismiss-btn {
        background: transparent;
        color: white;
        border: 1px solid white;
    }
    /* Login Overlay */
    .login-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(135deg, #1a365d 0%, #2d3748 100%);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 10000;
    }

    .login-overlay.hidden {
        display: none;
    }

    .login-box {
        background: white;
        padding: 40px;
        border-radius: 12px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.3);
        text-align: center;
        max-width: 320px;
        width: 90%;
    }

    .login-box h2 {
        margin: 0 0 10px 0;
        color: #1a365d;
    }

    .login-box p {
        margin: 0 0 20px 0;
        color: #666;
        font-size: 14px;
    }

    .login-box input {
        width: 100%;
        padding: 12px;
        border: 2px solid #ddd;
        border-radius: 6px;
        font-size: 16px;
        margin-bottom: 15px;
        box-sizing: border-box;
    }

        .login-box input:focus {
            border-color: #3182ce;
            outline: none;
        }

    .login-box button {
        width: 100%;
        padding: 12px;
        background: #3182ce;
        color: white;
        border: none;
        border-radius: 6px;
        font-size: 16px;
        cursor: pointer;
    }

        .login-box button:hover {
            background: #2c5aa0;
        }

    .login-error {
        color: #e53e3e;
        margin-top: 15px;
        display: none;
    }

    .login-error.visible {
        display: block;
    }

/* History Modal */
.history-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9000;
}

    .history-overlay.active {
        display: flex;
    }

.history-modal {
    background: white;
    width: 95%;
    max-width: 500px;
    max-height: 80vh;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #003366;
    color: white;
}

    .history-header h2 {
        margin: 0;
        font-size: 18px;
    }

.history-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
}

.history-breadcrumb {
    padding: 10px 15px;
    background: #f0f4f8;
    border-bottom: 1px solid #ddd;
    font-size: 14px;
}

    .history-breadcrumb span {
        color: #3182ce;
        cursor: pointer;
    }

        .history-breadcrumb span:hover {
            text-decoration: underline;
        }

    .history-breadcrumb .separator {
        color: #666;
        margin: 0 8px;
    }

    .history-breadcrumb .current {
        color: #333;
        cursor: default;
    }

        .history-breadcrumb .current:hover {
            text-decoration: none;
        }

    .history-content {
        flex: 1;
        overflow-y: auto;
        padding: 10px;
    }

    .history-folder {
        display: flex;
        align-items: center;
        padding: 12px 15px;
        margin: 5px 0;
        background: #f8f9fa;
        border-radius: 8px;
        cursor: pointer;
        transition: background 0.2s;
    }

        .history-folder:hover {
            background: #e9ecef;
        }

    .history-folder-icon {
        font-size: 24px;
        margin-right: 12px;
    }

    .history-folder-name {
        flex: 1;
        font-weight: 500;
    }

    .history-folder-count {
        color: #666;
        font-size: 14px;
    }

    .history-item {
        display: flex;
        align-items: center;
        padding: 12px 15px;
        margin: 5px 0;
        background: #fff;
        border: 1px solid #ddd;
        border-radius: 8px;
        cursor: pointer;
        transition: background 0.2s;
    }

        .history-item:hover {
            background: #f0f4f8;
        }

    .history-item-icon {
        font-size: 20px;
        margin-right: 12px;
    }

    .history-item-details {
        flex: 1;
    }

    .history-item-title {
        font-weight: 500;
        margin-bottom: 3px;
    }

    .history-item-subtitle {
        font-size: 12px;
        color: #666;
    }

    .history-empty {
        text-align: center;
        padding: 40px 20px;
        color: #666;
    }