:root {
    --bg-color: #ffffff;
    --text-color: #000000;
    --text-muted: #86868b;
    --border-color: #d2d2d7;
    --accent-color: #007aff; /* Default Apple Blue */
    --accent-red: #ff3b30;
    --accent-green: #34c759;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Theme Application */
.theme-rejections { --accent-color: var(--accent-red); }
.theme-wins { --accent-color: var(--accent-green); }
.theme-bigwins { --accent-color: #5856d6; }

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-family);
    padding: 2rem 1rem;
    /* Removed flex centering to prevent container shrinking */
}

.app-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.app-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 1rem 0;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Hub Styles */
.hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding-top: 2rem;
}

.hub-card {
    background: #f5f5f7;
    border-radius: 24px;
    padding: 2rem;
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.hub-card:hover {
    transform: translateY(-5px) scale(1.02);
    background: #ebebeb;
}

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.rejections .card-icon { background: var(--accent-red); }
.wins .card-icon { background: var(--accent-green); }
.bigwins .card-icon { background: #5856d6; }

.hub-card h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.hub-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.card-stats {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-color);
}

.card-arrow {
    margin-left: auto;
    font-size: 1.5rem;
    color: var(--border-color);
    transition: transform 0.3s;
}

.hub-card:hover .card-arrow {
    transform: translateX(5px);
    color: var(--text-color);
}

/* Tracker Page Styles */
.tracker-header {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 10;
    border-bottom: 0.5px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.btn-back {
    position: absolute;
    left: 0;
    top: 1.5rem;
    text-decoration: none;
    color: var(--text-color);
    background-color: #f5f5f7;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-back:hover {
    background-color: #e8e8ed;
    transform: translateX(-2px);
}

.btn-home {
    position: absolute;
    right: 0;
    top: 1.5rem;
    text-decoration: none;
    color: var(--text-muted);
    background-color: #f5f5f7;
    padding: 0.5rem;
    border-radius: 12px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    border: none;
    cursor: pointer;
}

.btn-home:hover {
    color: var(--text-color);
    background-color: #e8e8ed;
    transform: scale(1.05);
}

.btn-history-inline {
    margin: 0.5rem auto 1rem;
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
    border-radius: 99px;
    background: #f1f1f1;
    display: block;
}

.stats-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

#progress-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.progress-container {
    width: 200px;
    height: 4px;
    background: #f5f5f7;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent-color);
    transition: width 0.3s ease;
}

/* Grid Styles */
.grid-container, 
#rejection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 1.5rem;
    padding: 2rem 0;
    width: 100%;
}

.rejection-item {
    aspect-ratio: 1 / 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    font-size: 0.875rem;
    font-weight: 400;
    cursor: default;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    color: var(--text-muted);
    opacity: 0.3;
    pointer-events: none;
}

.rejection-item.marked {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    opacity: 1;
    pointer-events: auto;
    cursor: pointer;
}

.rejection-item.next-target {
    opacity: 1;
    pointer-events: auto;
    cursor: pointer;
    border-color: var(--text-color);
    color: var(--text-color);
    font-weight: 600;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.05); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(0, 0, 0, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); }
}

.rejection-item.marked:hover {
    transform: scale(0.95);
    opacity: 0.8;
}

.rejection-item.next-target:hover {
    transform: scale(1.1);
    background-color: #f5f5f7;
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #ffffff;
    padding: 1.5rem 2.5rem;
    border-radius: 20px;
    font-size: 1.1rem;
    font-weight: 500;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    z-index: 1000;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s;
    opacity: 0;
    pointer-events: none;
    text-align: center;
    width: auto;
    max-width: 90%;
}

.notification.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

/* Footer & Action Buttons */
.tracker-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 0.5px solid var(--border-color);
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding-bottom: 4rem;
}

.btn-secondary {
    background: #f5f5f7;
    border: none;
    color: var(--text-color);
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

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

/* Win History List Styles - Full Screen Standalone View */
.wins-history-section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    z-index: 2000;
    overflow-y: auto;
    padding: 2rem 1rem;
    transition: all 0.3s ease;
}

.wins-history-section.hidden {
    display: none;
}

.history-header {
    max-width: 800px;
    margin: 0 auto 3rem;
    text-align: center;
    position: relative;
}

.btn-back-list {
    position: absolute;
    left: 0;
    top: 0.5rem;
    background: none;
    border: none;
    color: var(--accent-color);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
}

.wins-history-section h2 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    margin-bottom: 0;
}

.wins-list-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding-bottom: 4rem;
}

.win-entry {
    background: #f5f5f7;
    padding: 1.5rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: transform 0.2s;
}

.win-number {
    width: 44px;
    height: 44px;
    background: var(--accent-green);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.win-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex-grow: 1;
}

.btn-edit-win {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-edit-win:hover {
    background: #e8e8ed;
    color: var(--text-color);
    transform: scale(1.1);
}

.win-note {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-color);
}

.win-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
}

.empty-msg {
    color: var(--text-muted);
    text-align: center;
    padding: 2rem 0;
    font-style: italic;
}

/* Auth Styling */
.auth-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f7;
}

.auth-card {
    background: white;
    padding: 3rem;
    border-radius: 32px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.05);
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    background: white;
    border: 1px solid #d2d2d7;
    padding: 0.8rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    margin: 2rem 0;
    transition: all 0.2s;
}

.btn-google:hover {
    background: #f5f5f7;
    border-color: #86868b;
}

.auth-footer {
    font-size: 0.8rem;
    color: #86868b;
}

@media (min-width: 1024px) {
    .app-container {
        max-width: 1200px;
        padding: 4rem 2rem;
    }

    h1 {
        font-size: 3.5rem;
    }

    .hub-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2.5rem;
    }

    .grid-container, 
    #rejection-grid {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
        gap: 1.5rem;
    }

    .rejection-item {
        font-size: 0.9rem;
    }

    .btn-history-inline {
        padding: 0.5rem 1.5rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 600px) {
    .grid-container {
        grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
        gap: 1rem;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .btn-back {
        position: relative;
        top: 0;
        margin-bottom: 1rem;
    }
}
