/* Grundlegende Reset-Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* Root-Variablen */
:root {
    --primary-color: #006838;
    --text-color: #333;
    --background-color: rgba(255, 255, 255, 0.9);
    --border-color: #ddd;
}

/* Body und Container */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    background: url('img/background.jpg') no-repeat center center fixed;
    background-size: cover;
    min-height: 100vh;
    color: var(--text-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: var(--primary-color);
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 8px;
    overscroll-behavior-y: contain;
}

/* Header */
header {
    margin-bottom: 8px;
    text-align: center;
    background-color: var(--background-color);
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.club-logo {
    height: 80px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.club-logo img {
    max-height: 100%;
    width: auto;
    object-fit: contain;
}

/* Courts Grid */
.courts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 8px;
    padding: 0;
}

.court-card {
    background-color: var(--background-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-height: 140px;
    display: flex;
    flex-direction: column;
}

.court-header {
    background-color: var(--primary-color);
    color: white;
    padding: 8px;
    font-size: 1.2em;
    font-weight: bold;
    text-align: center;
}

.scores-container {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 0 12px;
}

.set-numbers {
    display: grid;
    grid-template-columns: 200px repeat(3, 1fr);
    margin-bottom: 2px;
    padding: 5px 0 0;
}

.set-number {
    background-color: rgba(0, 104, 56, 0.7);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-weight: bold;
    font-size: 0.9em;
}

.player-name-spacer {
    /* Platzhalter für den Spielernamen-Bereich */
    width: 200px;
}

.player-row {
    display: grid;
    grid-template-columns: 200px repeat(3, 1fr);
    align-items: start;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-color);
    min-height: 36px;
}

.player-row:last-child {
    border-bottom: none;
    padding-bottom: 8px;
}

.player-name {
    padding-left: 10px;
    font-weight: 500;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
    overflow: visible;
    text-overflow: clip;
}

.player-name .tooltip-text {
    visibility: hidden;
    background-color: #006838;
    color: #fff;
    text-align: center;
    border-radius: 8px;
    padding: 6px 12px;
    position: absolute;
    z-index: 10;
    left: 50%;
    bottom: 125%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    font-size: 1em;
    min-width: 120px;
    white-space: normal;
    pointer-events: none;
}

/* Touch-Geräte Support */
@media (hover: none) {
    .player-name.active .tooltip-text {
        visibility: visible;
        opacity: 1;
    }
}

/* Desktop Support */
@media (hover: hover) {
    .player-name:hover .tooltip-text {
        visibility: visible;
        opacity: 1;
    }
}

.score {
    text-align: center;
    font-size: 1.2em;
    font-weight: bold;
    min-width: 30px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-container {
        padding: 4px;
    }

    header {
        margin-bottom: 4px;
        padding: 10px;
    }

    .courts-grid {
        grid-template-columns: 1fr;
        gap: 4px;
        padding: 0;
    }

    .club-logo {
        height: 60px;
    }

    .court-card {
        min-height: auto;
    }

    .court-header {
        padding: 6px;
    }

    .scores-container {
        padding: 0 10px;
    }

    .set-numbers {
        padding: 4px 0 0;
    }

    .player-row {
        padding: 5px 0;
        min-height: 32px;
    }

    .player-row:last-child {
        padding-bottom: 6px;
    }

    .set-number {
        width: 22px;
        height: 22px;
        font-size: 0.9em;
    }

    .score {
        font-size: 1.1em;
    }
}

/* iOS Specific Styles */
@supports (-webkit-touch-callout: none) {
    body {
        background-color: var(--primary-color);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .app-container {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        min-height: 100vh;
        background: url('img/background.jpg') no-repeat center center fixed;
        background-size: cover;
        overscroll-behavior-y: contain;
    }
}

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

.court-card {
    animation: fadeIn 0.3s ease-out;
}

/* Footer Styles temporär auskommentiert
.scorer-footer {
    text-align: center;
    padding: 20px 0;
    margin-top: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.scorer-logo {
    max-width: 120px;
    height: auto;
    opacity: 0.8;
    transition: opacity 0.3s ease;
    display: block;
    margin: 0 auto;
}

.scorer-logo:hover {
    opacity: 1;
}
*/

.error-card {
    text-align: center;
    padding: 20px;
}

.error-card .court-header {
    margin-bottom: 15px;
}

.error-message {
    font-size: 1.1em;
    color: var(--text-color);
    padding: 20px;
    line-height: 1.4;
}

/* Match Queue Styles */
#match-queue-section {
    margin-top: 40px !important;
}

.match-queue-card {
    background-color: rgba(255, 255, 255, 0.85);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.match-queue-header {
    background-color: rgba(220, 90, 40, 0.6);
    color: white;
    padding: 10px;
    font-size: 0.85em;
    font-weight: 600;
    text-align: center;
}

.match-queue-list {
    padding: 12px;
}

.match-queue-item {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1em;
    gap: 12px;
    min-height: 44px;
}

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

.match-queue-players {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0; /* Wichtig für Text-Overflow */
    flex-wrap: nowrap;
}

.match-queue-players span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.match-queue-players span:first-child {
    flex-shrink: 0;
    max-width: 45%;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
    text-overflow: clip;
    overflow: visible;
}

.match-queue-players span:last-child {
    flex-shrink: 0;
    max-width: 45%;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
    text-overflow: clip;
    overflow: visible;
}

.match-queue-players span:nth-child(2) {
    flex-shrink: 0;
    color: #999;
}

.match-queue-court {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9em;
    padding: 4px 10px;
    background-color: rgba(0, 104, 56, 0.1);
    border-radius: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.match-queue-empty {
    padding: 20px;
    text-align: center;
    color: #999;
    font-style: italic;
}

.match-queue-loading {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}

@media (max-width: 768px) {
    .match-queue-header {
        padding: 10px;
        font-size: 1.1em;
    }
    
    .match-queue-item {
        padding: 8px 10px;
        font-size: 0.95em;
        gap: 8px;
    }
    
    .match-queue-players {
        gap: 6px;
    }
    
    .match-queue-players span:first-child,
    .match-queue-players span:last-child {
        max-width: 40%;
        font-size: 0.9em;
    }
    
    .match-queue-court {
        font-size: 0.85em;
        padding: 3px 8px;
    }
} 