* {
    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: #f4f4f4;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background: #013369;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

header nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.5rem;
    margin-right: 1.5rem;
    white-space: nowrap;
}

header ul {
    list-style: none;
    display: flex;
    gap: 0.5rem;
    margin: 0;
    font-size: 0.95rem;
}

header .nav-links {
    flex: 1;
    gap: 0.75rem;
}

header .nav-right {
    margin-left: auto;
    gap: 0.5rem;
}

header a {
    color: white;
    text-decoration: none;
    transition: all 0.3s;
}

header a:hover {
    opacity: 0.8;
}

header .nav-links a {
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    display: inline-block;
    white-space: nowrap;
}

header .nav-links a:hover {
    background: rgba(255,255,255,0.1);
    opacity: 1;
}

header .nav-links a.active {
    background: rgba(255,255,255,0.2);
    font-weight: 600;
}

header .nav-right a {
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    display: inline-block;
    white-space: nowrap;
}

header .btn-login {
    background: rgba(255,255,255,0.2);
    padding: 0.4rem 0.8rem;
}

header .btn-login:hover {
    background: rgba(255,255,255,0.3);
    opacity: 1;
}

header .btn-admin {
    background: #ffc107;
    color: #333 !important;
    padding: 0.4rem 0.8rem;
    font-weight: 600;
}

header .btn-admin:hover {
    background: #ffcd38;
    opacity: 1;
}

header .btn-admin.active {
    background: #e0a800;
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    gap: 4px;
    z-index: 1001;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
    display: block;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

main {
    padding: 1rem 0;
    min-height: 70vh;
}

.hero {
    background: white;
    padding: 3rem;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.hero h2 {
    color: #013369;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.feature-card h3 {
    color: #013369;
    margin-bottom: 1rem;
}

.next-steps {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.next-steps h3 {
    color: #013369;
    margin-bottom: 1rem;
}

.next-steps ul {
    list-style: none;
}

.next-steps li {
    padding: 0.5rem 0;
    font-size: 1.1rem;
}

.error-page {
    background: white;
    padding: 3rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.error-page h2 {
    color: #d32f2f;
    margin-bottom: 1rem;
}

footer {
    background: #013369;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

footer a {
    color: #9ecbff;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.page-header {
    background: white;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.page-header h2 {
    color: #013369;
    margin: 0;
    font-size: 1.3rem;
}

.page-header p {
    margin: 0.2rem 0 0 0;
    font-size: 0.85rem;
}

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

.team-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s;
    text-align: center;
}

.team-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.team-logo {
    margin-bottom: 1rem;
}

.team-logo img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.team-card h3 {
    color: #013369;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.team-card p {
    margin: 0.5rem 0;
    color: #666;
}

.error-message {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.error-message h3 {
    color: #856404;
    margin-bottom: 1rem;
}

.error-message p {
    color: #856404;
    margin-bottom: 0.5rem;
}

.error-message .hint {
    font-weight: bold;
    margin-top: 1rem;
}

.error-message pre {
    background: #333;
    color: #fff;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    margin-top: 0.5rem;
}

.info-content {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.info-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #eee;
}

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

.info-section h3 {
    color: #013369;
    margin-bottom: 1rem;
}

.info-section p {
    line-height: 1.8;
    color: #333;
}

.info-section ul {
    line-height: 2;
    color: #666;
}

.info-section li {
    margin-bottom: 0.5rem;
}

.info-section .warning {
    color: #d32f2f;
    font-weight: 500;
}

.spreads-container {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.spreads-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}

.spreads-table thead {
    background: #013369;
    color: white;
}

.spreads-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.spreads-table tbody tr {
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.spreads-table tbody tr:hover {
    background: #f8f9fa;
}

.spreads-table td {
    padding: 1rem;
}

.team-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.team-logo-small {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.spread-value {
    font-weight: bold;
    font-size: 1.1rem;
    color: #013369;
}

.spread-time {
    color: #666;
    font-size: 0.9rem;
}

.spreads-info {
    padding: 1.5rem;
    background: #e3f2fd;
    border-radius: 8px;
    margin-top: 1rem;
}

.spreads-info p {
    margin: 0.5rem 0;
    color: #013369;
}

.no-data {
    text-align: center;
    padding: 3rem;
    color: #666;
    font-size: 1.1rem;
}

.feature-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.feature-link {
    display: block;
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
    text-align: center;
}

.feature-link:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    text-decoration: none;
}

.feature-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.feature-link strong {
    display: block;
    color: #013369;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.feature-link p {
    color: #666;
    font-size: 0.95rem;
    margin: 0;
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    position: relative;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.alert .close {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.5;
}

.alert .close:hover {
    opacity: 1;
}

/* Auth Pages */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.auth-box {
    background: white;
    padding: 3rem;
    border-radius: 10px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    max-width: 500px;
    width: 100%;
}

.auth-box h2 {
    color: #013369;
    text-align: center;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 2rem;
}

.auth-form {
    margin-bottom: 2rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-control:focus {
    outline: none;
    border-color: #013369;
    box-shadow: 0 0 0 2px rgba(1, 51, 105, 0.1);
}

.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: #666;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #013369;
    color: white;
}

.btn-primary:hover {
    background: #012347;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-block {
    width: 100%;
    display: block;
}

.auth-info {
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.auth-info h4 {
    color: #013369;
    margin-bottom: 1rem;
}

.auth-info ul {
    list-style: none;
    padding-left: 0;
}

.auth-info li {
    padding: 0.5rem 0;
    color: #666;
}

.auth-info li:before {
    content: "✓ ";
    color: #28a745;
    font-weight: bold;
    margin-right: 0.5rem;
}

/* Profile Page */
.page-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    flex-shrink: 0;
}

.profile-avatar-block {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
}

.profile-avatar-link {
    font-size: 0.8rem;
    color: #0056b3;
    text-align: right;
    max-width: 120px;
    line-height: 1.3;
}

.profile-avatar-link:hover {
    text-decoration: underline;
}

.nickname-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.nickname-form input[type="text"] {
    padding: 0.4rem 0.6rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    min-width: 140px;
    font-size: 1rem;
}

.profile-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .profile-container {
        grid-template-columns: 1fr;
    }
}

.api-token-box {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #eee;
}

.api-token-box h4 {
    color: #013369;
    margin: 0 0 0.4rem;
}

.api-token-box p {
    color: #666;
    font-size: 0.9rem;
    margin: 0 0 0.75rem;
}

.api-token-value {
    width: 100%;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.65rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.8rem;
}

.api-token-empty {
    font-style: italic;
}

.profile-info,
.profile-picks {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.profile-info h3,
.profile-picks h3 {
    color: #013369;
    margin-bottom: 1.5rem;
}

.info-table {
    width: 100%;
}

.info-table td {
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
}

.info-table tr:last-child td {
    border-bottom: none;
}

.badge {
    background: #ffc107;
    color: #000;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

.picks-table {
    width: 100%;
    border-collapse: collapse;
}

.picks-table th {
    background: #f8f9fa;
    padding: 0.75rem;
    text-align: left;
    border-bottom: 2px solid #dee2e6;
}

.picks-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #eee;
}

.result-correct {
    color: #28a745;
    font-weight: bold;
}

.result-incorrect {
    color: #dc3545;
    font-weight: bold;
}

.result-hidden {
    color: #999;
    font-style: italic;
}

.hidden-pick-placeholder {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #6c757d;
    font-style: italic;
    padding: 0.25rem 0.5rem;
    background: #e9ecef;
    border-radius: 4px;
    border: 1px solid #adb5bd;
}

.hidden-pick-placeholder svg {
    width: 18px;
    height: 18px;
    color: #6c757d;
}

.no-picks {
    text-align: center;
    padding: 2rem;
    color: #666;
}

/* OAuth Styles */
.oauth-section {
    margin-bottom: 2rem;
}

.btn-google {
    background: white;
    color: #444;
    border: 1px solid #ddd;
    padding: 12px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-google:hover {
    background: #f8f8f8;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: #999;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #ddd;
}

.divider span {
    padding: 0 10px;
    font-size: 0.9rem;
}

/* Default: Show table, hide mobile cards */
.games-table-desktop {
    display: block;
}

.games-cards-mobile {
    display: none;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    header nav .container {
        flex-wrap: wrap;
        position: relative;
    }
    
    .mobile-menu-toggle {
        display: flex;
        margin-left: auto;
    }
    
    header h1 {
        font-size: 1.25rem;
        margin-right: auto;
    }
    
    header .nav-links,
    header .nav-right {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 0;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    header .nav-links.mobile-open,
    header .nav-right.mobile-open {
        display: flex;
    }
    
    header .nav-links li,
    header .nav-right li {
        width: 100%;
    }
    
    header .nav-links a,
    header .nav-right a {
        display: block;
        width: 100%;
        padding: 0.75rem 1rem;
        border-radius: 4px;
        margin-bottom: 0.25rem;
    }
    
    header .nav-right {
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        margin-top: 0.5rem;
        padding-top: 0.5rem;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .hero {
        padding: 2rem 1.5rem;
    }
    
    .hero h2 {
        font-size: 1.75rem;
    }
    
    .features {
        grid-template-columns: 1fr;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
    
    .teams-grid {
        grid-template-columns: 1fr;
    }
    
    .spreads-container {
        padding: 1.5rem;
    }
    
    .spreads-table {
        font-size: 0.85rem;
    }
    
    .spreads-table th,
    .spreads-table td {
        padding: 0.5rem;
    }
    
    .team-info {
        flex-wrap: wrap;
    }
    
    .feature-links {
        grid-template-columns: 1fr;
    }
    
    .auth-box {
        padding: 2rem 1.5rem;
    }
    
    .info-content {
        padding: 1.5rem;
    }
    
    main {
        padding: 0.75rem 0;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.1rem;
    }
    
    .hero {
        padding: 1.5rem 1rem;
    }
    
    .hero h2 {
        font-size: 1.5rem;
    }
    
    .container {
        padding: 0 10px;
    }
    
    .page-header {
        padding: 0.5rem 0.75rem;
    }
    
    .page-header h2 {
        font-size: 1.1rem;
    }
}

/* Home Page Mobile Styles */
@media (max-width: 768px) {
    .welcome-message h2 {
        font-size: 1.5rem;
    }
    
    .home-leaderboard {
        padding: 1.5rem !important;
    }
    
    .home-leaderboard > div[style*="grid-template-columns: repeat(3"] {
        grid-template-columns: 1fr !important;
        gap: 0.5rem !important;
    }
    
    .jumbotron {
        padding: 2rem 1.5rem !important;
    }
    
    .jumbotron h1 {
        font-size: 2rem !important;
    }
    
    .jumbotron p {
        font-size: 1rem !important;
    }
    
    .features-row {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    .feature-box {
        padding: 1.5rem !important;
    }
    
    .games-table {
        font-size: 0.85rem;
    }
    
    .games-table th,
    .games-table td {
        padding: 0.5rem !important;
    }
    
    .games-table thead {
        display: none;
    }
    
    .games-table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #dee2e6;
        border-radius: 8px;
        padding: 0.75rem;
        background: white;
    }
    
    .games-table tbody td {
        display: block;
        text-align: left !important;
        padding: 0.25rem 0.5rem !important;
        border: none;
    }
    
    .games-table tbody td:before {
        content: attr(data-label) ": ";
        font-weight: bold;
        color: #013369;
    }
    
    .cta-section {
        padding: 2rem 1rem !important;
    }
    
    .cta-section h3 {
        font-size: 1.5rem !important;
    }
    
    .btn-large {
        padding: 0.75rem 1.5rem !important;
        font-size: 1rem !important;
    }
}

@media (max-width: 480px) {
    .jumbotron h1 {
        font-size: 1.75rem !important;
    }
    
    .home-leaderboard {
        padding: 1rem !important;
    }
    
    .feature-box {
        padding: 1rem !important;
    }
    
    .feature-icon {
        font-size: 2rem !important;
    }
    
    .current-week-games {
        overflow-x: auto;
    }
    
    .games-table {
        min-width: 600px;
    }
}

@media (max-width: 768px) {
    /* Hide table, show cards on mobile */
    .games-table-desktop {
        display: none;
    }
    
    .games-cards-mobile {
        display: block;
    }
    
    .home-game-card {
        transition: transform 0.2s, box-shadow 0.2s;
    }
    
    .home-game-card:active {
        transform: scale(0.98);
    }
    
    /* Ensure single line layout doesn't break */
    .home-game-card > div:nth-child(2) {
        min-width: 0; /* Allow flex items to shrink */
    }
    
    .home-game-card img {
        flex-shrink: 0;
    }
}

