:root {
    --primary-color: #f5bc42;
    --secondary-color: #8b4513;
    --background-color: #fff6e5;
    --text-color: #593614;
    --border-color: #deb887;
    --button-color: #f5bc42;
    --button-hover: #e6a734;
    --header-bg: #8b4513;
    --header-text: #ffffff;
    --screen-bg: #fff6e5;
    --table-header-bg: #deb887;
    --red-color: #ff0000;
    --yellow-color: #ffcc00;
    --green-color: #00cc00;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.app-container {
    max-width: 600px;
    margin: 0 auto;
    background-color: var(--screen-bg);
    min-height: 100vh;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

header {
    background-color: var(--header-bg);
    color: var(--header-text);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 1.8rem;
    font-weight: bold;
}

.profile-button {
    background-color: var(--button-color);
    border: none;
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

.profile-button:hover {
    background-color: var(--button-hover);
}

main {
    padding: 1rem;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

h2 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.current-level {
    background-color: #ffffff;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.level-display-container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin: 1rem 0;
}

.level-display {
    font-size: 3rem;
    font-weight: bold;
    color: #000000;
    margin: 0;
}

/* Verkehrsampel-Stil */
#trafficLightContainer {
    position: relative;
    margin-left: 20px;
    width: 35px;
    height: 90px;
    background-color: #333;
    border-radius: 10px;
    border: 2px solid #222;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    align-items: center;
    padding: 5px 0;
    box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.3);
}

.traffic-light-bulb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.2);
}

.traffic-light-bulb.red {
    background-color: #660000;
}

.traffic-light-bulb.yellow {
    background-color: #664400;
}

.traffic-light-bulb.green {
    background-color: #006600;
}

.traffic-light-bulb.active.red {
    background-color: #ff0000;
    box-shadow: 0 0 10px 2px #ff3333;
}

.traffic-light-bulb.active.yellow {
    background-color: #ffcc00;
    box-shadow: 0 0 10px 2px #ffdd55;
}

.traffic-light-bulb.active.green {
    background-color: #00cc00;
    box-shadow: 0 0 10px 2px #33ff33;
}

.drink-list {
    background-color: #ffffff;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

table th, table td {
    padding: 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

table th {
    background-color: var(--table-header-bg);
    font-weight: bold;
}

.add-button, .save-button {
    background-color: var(--button-color);
    border: none;
    color: var(--text-color);
    padding: 0.7rem 1.2rem;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
    width: 100%;
    margin-top: 1rem;
}

.add-button:hover, .save-button:hover {
    background-color: var(--button-hover);
}

.cancel-button {
    background-color: #e0e0e0;
    border: none;
    color: #333;
    padding: 0.7rem 1.2rem;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
    width: 100%;
    margin-top: 0.5rem;
}

.cancel-button:hover {
    background-color: #d0d0d0;
}

.small-button {
    background-color: var(--button-color);
    border: none;
    color: var(--text-color);
    padding: 0.3rem 0.6rem;
    border-radius: 3px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.small-button:hover {
    background-color: var(--button-hover);
}

.sober-times {
    background-color: #ffffff;
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.time-estimates {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.time-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.time-item:last-child {
    border-bottom: none;
}

.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: var(--secondary-color);
}

input, select {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(245, 188, 66, 0.2);
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.edit-button, .delete-button {
    padding: 0.3rem 0.6rem;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8rem;
}

.edit-button {
    background-color: #4caf50;
    color: white;
}

.delete-button {
    background-color: #f44336;
    color: white;
}

/* Beer-themed decorations */
.beer-bubble {
    position: absolute;
    background-color: rgba(245, 188, 66, 0.4); /* Bierfarbe statt weiß, mit leichter Transparenz */
    border: 1px solid rgba(245, 188, 66, 0.5); /* Subtiler Rand für mehr Sichtbarkeit */
    border-radius: 50%;
    animation: rise 10s infinite ease-in;
    z-index: 1; /* Vor anderen Elementen */
    pointer-events: none; /* Damit die Blasen keine Klicks abfangen */
    box-shadow: 0 0 3px rgba(245, 188, 66, 0.4); /* Leichtes Glühen */
}

@keyframes rise {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(-500%) translateX(20px);
        opacity: 0;
    }
}

/* Stilregeln für den maximalen Alkoholpegel */
.max-alcohol-container {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border-color);
}

.max-alcohol-container h3 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

/* Stilregeln für den Alkohol-Zeitstrahl */
.timeline-container {
    background-color: #ffffff;
    padding: 1rem;
    border-radius: 10px;
    margin: 1.5rem 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.timeline-chart {
    position: relative;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    padding: 0;
    height: auto;
}

/* Vertikaler Zeitstrahl */
.timeline-vertical {
    position: relative;
    padding: 20px 0;
    margin-left: 120px; /* Platz für die Zeitangaben */
}

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

.timeline-entry-vertical {
    position: relative;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
}

.timeline-entry-vertical.current {
    font-weight: bold;
}

.timeline-entry-vertical.zero {
    color: var(--green-color);
}

.timeline-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: var(--primary-color);
    border: 2px solid var(--secondary-color);
    position: absolute;
    left: 0;
    transform: translateX(-50%);
    z-index: 2;
}

.timeline-entry-vertical.current .timeline-dot {
    width: 18px;
    height: 18px;
    background-color: var(--secondary-color);
}

.timeline-entry-vertical.zero .timeline-dot {
    background-color: var(--green-color);
}

.timeline-time-vertical {
    position: absolute;
    left: -140px;
    width: 120px;
    text-align: right;
    padding-right: 20px;
}

.timeline-hour-vertical {
    font-size: 0.9rem;
    color: var(--text-color);
    font-weight: bold;
}

.timeline-date-vertical {
    font-size: 0.7rem;
    color: #666;
}

.timeline-bar-vertical {
    height: 30px;
    background-color: var(--primary-color);
    border-radius: 0 5px 5px 0;
    margin-left: 20px;
    position: relative;
    display: flex;
    align-items: center;
    min-width: 30px;
    max-width: 80%;  /* Begrenze die maximale Breite */
}

.timeline-value-vertical {
    padding-left: 10px;
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--text-color);
    white-space: nowrap;
}

.timeline-entry-vertical.current .timeline-bar-vertical {
    height: 35px;
    border: 2px solid var(--secondary-color);
    border-left: none;
}

.timeline-entry-vertical.zero .timeline-bar-vertical {
    background-color: #cccccc;
}

@media (max-width: 600px) {
    .app-container {
        width: 100%;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .level-display {
        font-size: 2.5rem;
    }
    
    .timeline-vertical {
        margin-left: 90px;
    }
    
    .timeline-time-vertical {
        left: -100px;
        width: 80px;
    }
    
    .timeline-hour-vertical {
        font-size: 0.8rem;
    }
    
    .timeline-date-vertical {
        font-size: 0.7rem;
    }
    
    .timeline-value-vertical {
        font-size: 0.8rem;
    }
}