* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

.header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    position: relative;
    padding-top: 80px; /* Creates space at the top so the title does not overlap the auth buttons */
}

.header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Authentication Section */
.auth-section {
    position: absolute;
    top: 20px;         /* Push the auth container slightly down for visual spacing */
    right: 20px;       /* Add spacing from the right edge */
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 100;      /* Ensure auth section stays above the header title */
}

.user-info {
    background: rgba(255, 255, 255, 0.15);
    padding: 10px 20px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

.login-btn {
    background: #ff4500;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.login-btn:hover {
    background: #e03d00;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.logout-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.user-badge {
    background: #28a745;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.rate-limit-info {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 15px 25px;
    border-radius: 15px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.rate-limit-upgrade {
    background: linear-gradient(45deg, #ff6b35, #f7931e);
    color: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.rate-limit-upgrade h3 {
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.rate-limit-upgrade p {
    margin-bottom: 15px;
    opacity: 0.9;
}

.tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    gap: 10px;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.tab-btn.active {
    background: white;
    color: #667eea;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.tab-content {
    display: none;
}

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

.search-section {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    margin-bottom: 40px;
}

.search-form {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.input-group {
    position: relative;
    flex: 1;
    max-width: 300px;
}

.input-group input, .input-group select {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 50px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    outline: none;
}

.input-group input:focus, .input-group select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-group label {
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    color: #999;
    font-size: 1.1rem;
    pointer-events: none;
    transition: all 0.3s ease;
}

.input-group input:focus + label,
.input-group input:not(:placeholder-shown) + label {
    top: -10px;
    left: 15px;
    font-size: 0.9rem;
    color: #667eea;
    background: white;
    padding: 0 10px;
}

.analyze-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.analyze-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(102, 126, 234, 0.4);
}

.analyze-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.loading {
    display: none;
    text-align: center;
    margin: 40px 0;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.results {
    display: none;
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.results h2 {
    color: #333;
    margin-bottom: 30px;
    font-size: 2rem;
    text-align: center;
}

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

.analysis-card {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    border-left: 5px solid #667eea;
}

.analysis-card h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e1e5e9;
}

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

.stat-label {
    font-weight: 500;
    color: #666;
}

.stat-value {
    font-weight: bold;
    color: #333;
}

.strategy-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    margin-top: 30px;
}

.strategy-section h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.recommendation-list {
    list-style: none;
}

.recommendation-list li {
    background: white;
    margin: 10px 0;
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #28a745;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.pain-points-list li {
    border-left-color: #dc3545;
}

.timing-list li {
    border-left-color: #17a2b8;
}

.content-list li {
    border-left-color: #ffc107;
}

.posts-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 30px;
}

.posts-card {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
}

.post-item {
    background: white;
    margin: 10px 0;
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.post-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.post-title {
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.post-title a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-title a:hover {
    color: #4c63d2;
    text-decoration: underline;
}

.post-stats {
    font-size: 0.9rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 5px;
}

.reddit-link {
    margin-left: auto;
    background: #ff4500;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.reddit-link:hover {
    background: #e03d00;
    color: white;
    text-decoration: none;
    transform: scale(1.05);
}

.post-generator {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.generator-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.textarea-group {
    position: relative;
}

.textarea-group textarea {
    width: 100%;
    min-height: 120px;
    padding: 15px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 15px;
    font-size: 1rem;
    resize: vertical;
    outline: none;
    transition: all 0.3s ease;
}

.textarea-group textarea:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.generated-post {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    margin-top: 20px;
    border-left: 5px solid #28a745;
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: #5a67d8;
}

.copy-btn.copied {
    background: #28a745;
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    text-align: center;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 60px;
}

.feature-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    color: white;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.feature-card h3 {
    margin-bottom: 15px;
    font-size: 1.3rem;
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .auth-section {
        position: static;
        justify-content: center;
        margin-top: 20px;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .input-group {
        max-width: 100%;
    }
    
    .analysis-grid {
        grid-template-columns: 1fr;
    }
    
    .posts-section {
        grid-template-columns: 1fr;
    }
    
    .tabs {
        flex-direction: column;
        align-items: center;
    }
}

/* Notification styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 1000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification.error {
    background: #dc3545;
} 