/* Reset and Base Styles */
* {
    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: #333;
    background: linear-gradient(135deg, #003366 0%, #004080 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    overflow: hidden;
}

/* Header */
header {
    background: #003366;
    color: white;
    padding: 30px;
    text-align: center;
}

.university-name {
    font-size: 0.9em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.95;
    margin-bottom: 15px;
}

header h1 {
    font-size: 2em;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.95;
    margin-bottom: 20px;
}

.header-actions {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.btn-large {
    padding: 16px 32px;
    font-size: 18px;
    width: auto;
    min-width: 250px;
}

.update-info {
    font-size: 0.9em;
    opacity: 0.9;
    margin: 0;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    background: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
}

.tab-btn {
    flex: 1;
    padding: 16px 24px;
    background: transparent;
    border: none;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    background: #f0f0f0;
    color: #003366;
}

.tab-btn.active {
    color: #003366;
    background: white;
    border-bottom: 3px solid #003366;
}

/* Tab Content */
.tab-content {
    display: none;
}

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

/* Section Styles */
.section {
    padding: 30px;
}

.hidden {
    display: none;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

input[type="text"],
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #003366;
}

textarea {
    resize: vertical;
    font-family: inherit;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: white;
    color: #003366;
    width: 100%;
    border: 2px solid white;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    background: #f8f9fa;
    border-color: #f8f9fa;
}

.btn-secondary {
    background: #f5f5f5;
    color: #666;
    width: 100%;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.button-group .btn {
    flex: 1;
}

/* Judge Info */
.judge-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.judge-label {
    font-weight: 600;
    color: #666;
}

.judge-name {
    font-size: 1.1em;
    font-weight: 700;
    color: #003366;
    flex: 1;
    margin-left: 10px;
}

/* Team Selector */
.team-selector {
    margin-bottom: 30px;
}

/* Scoring Section */
.scoring-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.score-item {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #e0e0e0;
}

.score-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.score-item label {
    font-size: 1.1em;
    color: #333;
    margin-bottom: 5px;
}

.score-description {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 15px;
    font-style: italic;
}

.score-input {
    display: flex;
    align-items: center;
    gap: 15px;
}

input[type="range"] {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #003366;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 51, 102, 0.4);
}

input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #003366;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 51, 102, 0.4);
}

.score-value {
    font-size: 1.5em;
    font-weight: 700;
    color: #003366;
    min-width: 40px;
    text-align: center;
}

.score-total {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #003366;
    font-size: 1.2em;
    text-align: center;
}

.score-total span {
    color: #003366;
    font-size: 1.3em;
}

/* Notes Section */
.notes-section {
    margin-bottom: 20px;
}

.notes-section label {
    margin-top: 15px;
}

/* Teams Section */
.teams-header {
    margin-bottom: 25px;
    text-align: center;
}

.teams-header h2 {
    font-size: 1.8em;
    color: #333;
    margin-bottom: 10px;
}

.teams-subtitle {
    font-size: 1em;
    color: #666;
    margin: 0;
}

.teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.team-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border-left: 4px solid #003366;
    transition: all 0.3s;
    position: relative;
}

.team-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 51, 102, 0.2);
}

.team-card.finalist {
    border-left-width: 6px;
    background: linear-gradient(135deg, rgba(0, 51, 102, 0.05) 0%, rgba(0, 64, 128, 0.05) 100%);
}

.finalist-badge {
    display: inline-block;
    background: #003366;
    color: white;
    font-size: 0.75em;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 4px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 51, 102, 0.3);
}

.team-image {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.team-name {
    font-size: 1.3em;
    color: #003366;
    margin-bottom: 12px;
    font-weight: 700;
}

.team-members {
    font-size: 0.95em;
    color: #555;
    margin-bottom: 15px;
    font-weight: 600;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.team-description {
    font-size: 0.95em;
    color: #666;
    line-height: 1.6;
}

.loading-message,
.error-message {
    text-align: center;
    color: #666;
    padding: 40px 20px;
    font-size: 1.1em;
}

.error-message {
    color: #f44336;
}

/* Results */
.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.results-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.results-list {
    max-height: 500px;
    overflow-y: auto;
}

.result-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #003366;
}

.result-team {
    font-size: 1.2em;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}

.result-scores {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.result-score-item {
    background: white;
    padding: 10px;
    border-radius: 6px;
}

.result-score-label {
    font-size: 0.85em;
    color: #666;
    display: block;
}

.result-score-value {
    font-size: 1.3em;
    font-weight: 700;
    color: #003366;
}

.result-judge {
    font-size: 0.9em;
    color: #666;
    font-style: italic;
}

/* Message */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

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

.message.success {
    background: #4caf50;
    color: white;
}

.message.error {
    background: #f44336;
    color: white;
}

.message.info {
    background: #2196f3;
    color: white;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        border-radius: 8px;
    }

    header h1 {
        font-size: 1.5em;
    }

    .subtitle {
        font-size: 1em;
    }

    .btn-large {
        min-width: 200px;
        font-size: 16px;
        padding: 14px 28px;
    }

    .section {
        padding: 20px;
    }

    .judge-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .judge-name {
        margin-left: 0;
    }

    .button-group {
        flex-direction: column;
    }

    .score-input {
        flex-direction: column;
        align-items: stretch;
    }

    .score-value {
        text-align: left;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .results-controls {
        width: 100%;
    }

    .results-controls .btn {
        flex: 1;
    }

    .teams-grid {
        grid-template-columns: 1fr;
    }

    .message {
        left: 10px;
        right: 10px;
        top: 10px;
    }
}

@media (max-width: 480px) {
    header {
        padding: 20px;
    }

    header h1 {
        font-size: 1.3em;
    }

    .btn-large {
        min-width: 180px;
        font-size: 15px;
        padding: 12px 24px;
    }

    .section {
        padding: 15px;
    }

    .scoring-section {
        padding: 15px;
    }

    .result-scores {
        grid-template-columns: 1fr;
    }

    .teams-header h2 {
        font-size: 1.4em;
    }

    .team-card {
        padding: 15px;
    }
}
