/* 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, #e0e0e0 0%, #b0b0b0 100%);
    min-height: 100vh;
}

/* Hide content initially until redirect check completes */
body.loading .container {
    visibility: hidden;
}

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

/* Header styles */
header {
    text-align: center;
    padding: 20px 20px;
    color: #333;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 5px;
    font-weight: 700;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.8;
    color: #555;
}

/* Main content */
main {
    background: white;
    border-radius: 15px;
    padding: 40px;
    margin: 20px 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* Step Section */
.step-section {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 2px solid #e0e0e0;
}

.step-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.step-number {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #4caf50 0%, #2e7d32 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
}

.step-content {
    flex: 1;
}

.step-content h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #333;
}

.step-description {
    color: #666;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.unread-count-large {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
    display: block;
    margin-bottom: 10px;
    line-height: 1.3;
}

.subtitle-question {
    font-size: 0.95rem;
    color: #666;
    display: block;
    margin-top: 10px;
}

/* Permissions Box */
.permissions-box {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
    border-left: 4px solid #4285F4;
}

.permissions-box h3 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: #333;
}

.permissions-list {
    list-style: none;
    padding: 0;
}

.permissions-list li {
    padding: 8px 0;
    color: #555;
    font-size: 0.9rem;
}

/* Gmail OAuth Button */
.gmail-oauth-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 24px;
    background: white;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    color: #3c4043;
    cursor: pointer;
    transition: box-shadow 0.2s ease, background-color 0.2s ease;
    margin-bottom: 15px;
}

.gmail-oauth-button:hover {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    background: #f8f9fa;
}

.gmail-oauth-button:active {
    background: #f1f3f4;
}

/* Step 1 authenticated state - faded and grey button */
.step-section.authenticated {
    opacity: 0.5;
}

.step-section.authenticated .gmail-oauth-button {
    background: #d0d0d0;
    border-color: #b0b0b0;
    color: #666;
}

.step-section.authenticated .gmail-oauth-button:hover {
    background: #d0d0d0;
    box-shadow: none;
}

.gmail-icon {
    flex-shrink: 0;
}

.privacy-note {
    font-size: 0.85rem;
    color: #666;
    text-align: center;
}

.privacy-note a {
    color: #4285F4;
    text-decoration: none;
}

.privacy-note a:hover {
    text-decoration: underline;
}

/* Junk Options Container */
.junk-options-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.junk-option {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
}

.junk-option:hover {
    border-color: #4285F4;
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.15);
    transform: translateY(-2px);
}

.junk-option.selected {
    border-color: #4caf50;
    background: #f1f8f4;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.2);
}

.option-content {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    width: 100%;
    min-height: 100%;
}

.option-radio {
    flex: 1;
    min-width: 0;
}

.option-radio input[type="radio"] {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #4caf50;
    margin-top: 2px;
    flex-shrink: 0;
}

.option-radio label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 1rem;
    color: #333;
    font-weight: 500;
}

.option-title {
    flex: 1;
}

.option-title-list {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
}

.option-title-list li {
    padding: 2px 0;
    line-height: 1.5;
}

.option-image {
    flex-shrink: 0;
    width: 300px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.option-image img {
    width: 100%;
    height: auto;
    display: block;
}

.junk-option.selected .option-image {
    border-color: #4caf50;
}

/* Disabled state for step 2 */
.step-section.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.step-section.disabled .junk-option {
    cursor: not-allowed;
}

.step-section.disabled .step-2-content {
    visibility: hidden;
}

/* Unjunk button */
.unjunk-button {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #4caf50 0%, #2e7d32 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.unjunk-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.unjunk-button:active {
    transform: translateY(0);
}

.unjunk-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px 20px;
    color: #555;
    opacity: 0.8;
    font-size: 0.85rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    main {
        padding: 25px 20px;
    }
    
    .step-section {
        flex-direction: column;
        gap: 15px;
    }
    
    .step-number {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .step-content h2 {
        font-size: 1.3rem;
    }
    
    .option-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .option-image {
        width: 100%;
    }
}
