/* Dolaro Bau Begleiter - Improved Styles */

:root {
    --primary-color: #1a73e8;
    --primary-dark: #1557b0;
    --secondary-color: #34a853;
    --danger-color: #ea4335;
    --warning-color: #fbbc04;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --border-color: #dadce0;
    --background: #f8f9fa;
    --surface: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
    --shadow-md: 0 2px 4px 0 rgba(60,64,67,0.3), 0 4px 8px 3px rgba(60,64,67,0.15);
    --shadow-lg: 0 4px 6px 0 rgba(60,64,67,0.3), 0 8px 16px 6px rgba(60,64,67,0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    overflow: hidden;
}

.screen {
    display: none;
    width: 100%;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
}

.screen.active {
    display: block;
}

/* Modal Improvements */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--surface);
    border-radius: 16px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease-out;
}

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

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 500;
    color: var(--text-primary);
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-secondary);
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close-btn:hover {
    background: var(--background);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* Modern Construction Steps */
.construction-steps {
    margin-bottom: 32px;
}

.construction-steps h3 {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 16px;
}

#stepsList {
    display: grid;
    gap: 12px;
}

.step-item-modern {
    background: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.step-item-modern::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--border-color);
    transition: all 0.2s;
}

.step-item-modern:hover {
    border-color: var(--primary-color);
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.step-item-modern:hover::before {
    background: var(--primary-color);
}

.step-item-modern.completed {
    background: linear-gradient(135deg, #e8f5e9 0%, #f1f8f4 100%);
    border-color: var(--secondary-color);
}

.step-item-modern.completed::before {
    background: var(--secondary-color);
}

.step-item-modern.saving {
    opacity: 0.6;
    pointer-events: none;
}

.step-checkbox-modern {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.step-item-modern.completed .step-checkbox-modern {
    color: var(--secondary-color);
}

.step-content {
    flex: 1;
    min-width: 0;
}

.step-code-modern {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.step-name-modern {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 500;
}

.step-meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Modern Timeline */
.timeline-section {
    background: var(--background);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 80px;
}

.timeline-section h3 {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 20px;
}

#timelineList {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 8px;
}

#timelineList::-webkit-scrollbar {
    width: 6px;
}

#timelineList::-webkit-scrollbar-track {
    background: transparent;
}

#timelineList::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

#timelineList::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.timeline-item-modern {
    position: relative;
    padding-left: 50px;
    padding-bottom: 24px;
}

.timeline-item-modern:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: 15px;
    top: 8px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 3px solid var(--surface);
    box-shadow: 0 0 0 2px var(--primary-color);
    z-index: 2;
}

.timeline-item-modern.step .timeline-dot {
    background: var(--secondary-color);
    box-shadow: 0 0 0 2px var(--secondary-color);
}

.timeline-item-modern.note .timeline-dot {
    background: var(--warning-color);
    box-shadow: 0 0 0 2px var(--warning-color);
}

.timeline-item-modern.comment .timeline-dot {
    background: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-color);
}

.timeline-line {
    position: absolute;
    left: 19px;
    top: 20px;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
    z-index: 1;
}

.timeline-icon {
    position: absolute;
    left: 0;
    top: 4px;
    font-size: 20px;
}

.timeline-content-modern {
    background: var(--surface);
    border-radius: 10px;
    padding: 12px 16px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

.timeline-content-modern:hover {
    box-shadow: var(--shadow-md);
}

.timeline-header-modern {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.timeline-user {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.timeline-date {
    font-size: 12px;
    color: var(--text-secondary);
}

.timeline-text-modern {
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.timeline-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Fixed Note Input at Bottom */
.note-input {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border-color);
    padding: 16px 24px;
    display: flex;
    gap: 12px;
    align-items: flex-end;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.note-input textarea {
    flex: 1;
    resize: none;
    border: 2px solid var(--border-color);
    border-radius: 24px;
    padding: 12px 20px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    transition: all 0.2s;
    max-height: 120px;
}

.note-input textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.note-input button {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.note-input button:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-md);
    transform: scale(1.05);
}

.note-input button:active {
    transform: scale(0.95);
}

.note-input button::before {
    content: '➤';
}

/* Comments Section - Removed (now in timeline) */
.comments-section {
    display: none;
}

/* Building Info */
.building-info {
    background: var(--background);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.info-row {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.info-row:last-child {
    border-bottom: none;
}

.info-row .label {
    font-weight: 600;
    color: var(--text-secondary);
    width: 120px;
    flex-shrink: 0;
}

.info-row span:last-child {
    color: var(--text-primary);
}

/* Map Container */
.map-container-fullscreen {
    width: 100%;
    height: calc(100vh - 70px);
}

/* Google Maps Header (keeping existing styles) */
.gmaps-header {
    background: white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    z-index: 1000;
}

.gmaps-logo {
    display: flex;
    align-items: center;
}

.gmaps-logo-img {
    height: 40px;
}

.gmaps-search-container {
    flex: 1;
    max-width: 600px;
    position: relative;
}

.gmaps-search-wrapper {
    background: #f1f3f4;
    border-radius: 24px;
    display: flex;
    align-items: center;
    padding: 10px 20px;
    transition: all 0.2s;
}

.gmaps-search-wrapper:focus-within {
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.gmaps-search-icon {
    font-size: 20px;
    margin-right: 12px;
    color: var(--text-secondary);
}

.gmaps-search-input {
    flex: 1;
    border: none;
    background: none;
    font-size: 16px;
    outline: none;
}

.gmaps-clear-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    margin-left: 8px;
    border-radius: 50%;
    transition: all 0.2s;
}

.gmaps-clear-btn:hover {
    background: var(--border-color);
}

.gmaps-logout-btn {
    background: var(--background);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.gmaps-logout-btn:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

/* Toast notifications */
.error-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--danger-color);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 10001;
    transition: transform 0.3s ease-out;
    font-weight: 500;
}

.error-toast.show {
    transform: translateX(-50%) translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .modal-content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .modal-header {
        padding: 16px;
    }
    
    .modal-body {
        padding: 16px;
    }
    
    .note-input {
        padding: 12px 16px;
    }
    
    .step-item-modern {
        padding: 12px;
    }
    
    .gmaps-header {
        flex-wrap: wrap;
        padding: 8px 12px;
    }
    
    .gmaps-search-container {
        order: 3;
        width: 100%;
        margin-top: 8px;
    }
}

/* Login Screen (keeping existing) */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 40px;
    background: var(--surface);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}

.logo-container {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    max-width: 120px;
    height: auto;
    margin-bottom: 20px;
}

.login-form input {
    width: 100%;
    padding: 14px;
    margin-bottom: 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s;
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

/* Offline Indicator */
.offline-indicator {
    position: fixed;
    top: 80px;
    right: 20px;
    background: var(--danger-color);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    z-index: 9999;
    animation: slideIn 0.3s ease-out;
}

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