/* RampenAssist - Professionelle Styling */

:root {
    --primary-dark: #0A2438;
    --primary-medium: #1A5A7F;
    --primary-light: #6F9DB5;
    --accent-light: #A8DCF4;
    --accent-lighter: #DBEDF6;
    --accent-lightest: #C2E5F5;
    --neutral-dark: #5A6B79;
    --neutral-medium: #A7B1B8;
    --neutral-light: #DFE6EA;
    --background-color: #F8FAFB;
    --surface-color: #FFFFFF;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --border-color: #E5E7EB;
    --primary-color: #1A5A7F;
    --primary-hover: #0A2438;
    --error-color: #E74C3C;
    --warning-color: #FFC107;
    --success-color: #28A745;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
}

/* Lucide Icon Styling */
.header-icon {
    width: 2.5rem;
    height: 2.5rem;
}

.tab-icon {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.5rem;
}

.section-icon {
    width: 1.5rem;
    height: 1.5rem;
    vertical-align: middle;
    margin-right: var(--spacing-sm);
}

.card-icon {
    width: 2rem;
    height: 2rem;
    margin-bottom: var(--spacing-sm);
    color: var(--primary-medium);
}

.info-button i {
    width: 16px;
    height: 16px;
}

.close-button i {
    width: 20px;
    height: 20px;
}

/* Reset und Basis */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: #2c3e50;  /* Dunkler Hintergrund */
    min-height: 100vh;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--spacing-md);
    min-height: 100vh;
}

header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

header h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
}

.logo, .header-icon {
    font-size: 1.2em;
    background: rgba(255, 255, 255, 0.2);
    padding: var(--spacing-sm);
    border-radius: var(--radius-md);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 400;
}

.tab-navigation {
    display: flex;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-xl);
    background: var(--surface-color);
    padding: var(--spacing-sm);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}

.tab-button {
    flex: 1;
    min-width: 140px;
    padding: var(--spacing-md) var(--spacing-lg);
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tab-button:hover {
    background: var(--background-color);
    color: var(--text-primary);
}

.tab-button.active {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-sm);
}

.tab-button:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.tab-panel {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.tab-panel.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-section {
    background: var(--surface-color);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.form-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--spacing-lg);
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
}

.input-group {
    margin-bottom: var(--spacing-lg);
    position: relative;
}

.input-group label {
    display: block;
    font-weight: 500;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
}

.label-with-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.label-with-info label {
    margin-bottom: 0;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
}

input[type="text"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: var(--spacing-md);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all 0.2s ease;
    background: var(--surface-color);
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input[type="number"].calculated {
    background: var(--background-color);
    font-weight: 600;
    color: var(--primary-color);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.info-button {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.info-button:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
}

.rampentyp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.rampentyp-card {
    display: block;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rampentyp-card input[type="radio"] {
    display: none;
}

.card-content {
    padding: var(--spacing-lg);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-align: center;
    background: var(--surface-color);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.rampentyp-card:hover .card-content {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.rampentyp-card input[type="radio"]:checked + .card-content {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
    box-shadow: var(--shadow-md);
}

.card-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.card-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.checkbox-group {
    margin-bottom: var(--spacing-lg);
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    gap: var(--spacing-md);
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    position: relative;
    transition: all 0.2s ease;
    background: var(--surface-color);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 14px;
    font-weight: bold;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.primary-button,
.export-button,
.upload-button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    min-height: 48px;
}

.primary-button:hover,
.export-button:hover,
.upload-button:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.primary-button {
    width: 100%;
    margin-top: var(--spacing-lg);
}

.berechnung-container {
    display: grid;
    gap: var(--spacing-lg);
}

.ergebnis-karte {
    background: var(--surface-color);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.ergebnis-karte h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.parameter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.parameter-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--border-color);
}

.parameter-label {
    font-weight: 500;
    color: var(--text-primary);
}

.parameter-wert {
    font-weight: 600;
    color: var(--primary-color);
}

.warnung {
    background: rgba(217, 119, 6, 0.1);
    border: 1px solid var(--warning-color);
    color: #92400e;
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin: var(--spacing-md) 0;
}

.fehler {
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid var(--error-color);
    color: #991b1b;
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin: var(--spacing-md) 0;
}

.erfolg {
    background: rgba(5, 150, 105, 0.1);
    border: 1px solid var(--success-color);
    color: #065f46;
    padding: var(--spacing-md);
    border-radius: var(--spacing-md);
    margin: var(--spacing-md) 0;
}

.photo-upload-area {
    text-align: center;
    padding: var(--spacing-xl);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-lg);
    transition: all 0.2s ease;
}

.photo-upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.02);
}

.upload-text {
    margin-top: var(--spacing-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

.photo-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.photo-item:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}

.photo-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.photo-delete {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    background: rgba(220, 38, 38, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--spacing-md);
}

.modal-content {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

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

.modal-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
}

.close-button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

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

.modal-body {
    padding: var(--spacing-lg);
    line-height: 1.6;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: var(--spacing-md);
}

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

.status-message {
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin: var(--spacing-md) 0;
    font-weight: 500;
}

.status-message.success {
    background: rgba(5, 150, 105, 0.1);
    border: 1px solid var(--success-color);
    color: #065f46;
}

.status-message.error {
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid var(--error-color);
    color: #991b1b;
}

.info-text {
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: var(--spacing-xl);
}

@media (max-width: 768px) {
    .container {
        padding: var(--spacing-sm);
    }
    
    header {
        padding: var(--spacing-md);
    }
    
    .form-section {
        padding: var(--spacing-lg);
    }
    
    .tab-navigation {
        flex-wrap: wrap;
    }
    
    .tab-button {
        min-width: auto;
        flex: 1 1 45%;
    }
    
    .input-row {
        grid-template-columns: 1fr;
    }
    
    .parameter-grid {
        grid-template-columns: 1fr;
    }
    
    .rampentyp-grid {
        grid-template-columns: 1fr;
    }
}

/* Stufentiefen Container */
.stufentiefen-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-sm);
}

.stufentiefe-item {
    display: flex;
    flex-direction: column;
}

.stufentiefe-item label {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
    color: var(--text-secondary);
}

.stufentiefe-item input {
    padding: var(--spacing-sm);
}
