/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --lightest-mint-cream: #E8EAF6;
    --light-mint-cream: #C5CAE9;
    --mint-cream: #9FA8DA;
    --celadon: #7986CB;
    --light-celadon: #BDBDBD;
    --cambridge-blue: #5C6BC0;
    --reseda-green: #3F51B5;
    --reseda-test: #3949AB;
    --dim-gray: #303F9F;
    --brunswick: #283593;
    --green-dark: #1A237E;
    --reseda-lighter: #7986CB;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--reseda-green) 0%, var(--dim-gray) 100%);
    min-height: 100vh;
    color: #333;
}

/* Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem 2rem;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-brand h2 {
    color: var(--reseda-green);
    margin: 0;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: #555;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link:hover {
    background: rgba(63, 81, 181, 0.1);
    color: var(--reseda-green);
}

.nav-link.active {
    background: var(--reseda-green);
    color: white;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* Authentication */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
}

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 3rem;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    color: var(--reseda-green);
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: #666;
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #333;
}

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

.form-group i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.form-group input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--reseda-green);
    box-shadow: 0 0 0 3px rgba(63, 81, 181, 0.1);
}

.auth-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--reseda-green) 0%, var(--dim-gray) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(63, 81, 181, 0.3);
}

.auth-switch {
    text-align: center;
    margin-top: 1.5rem;
    color: #666;
}

.auth-switch a {
    color: var(--reseda-green);
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Main App */
.main-app {
    margin-top: 80px;
    padding: 2rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

/* Home Page */
.home-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    margin-top: 2rem;
}

.stories-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    height: fit-content;
}

.stories-section h3 {
    color: var(--reseda-green);
    margin-bottom: 1rem;
}

.stories-grid {
    display: grid;
    gap: 1rem;
}

.posts-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.create-post {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.post-input {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.post-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.post-input input {
    flex: 1;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 1rem;
    background: #f8f9fa;
}

.post-input input:focus {
    outline: none;
    border-color: var(--reseda-green);
}

.post-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.post-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.post-btn:hover {
    border-color: var(--reseda-green);
    color: var(--reseda-green);
}

.post-btn.primary {
    background: var(--reseda-green);
    color: white;
    border-color: var(--reseda-green);
}

.post-btn.primary:hover {
    background: var(--reseda-test);
}

.posts-feed {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Chat Page */
.chat-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    height: calc(100vh - 120px);
    margin-top: 2rem;
}

.chat-sidebar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.chat-header {
    padding: 2rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    color: var(--reseda-green);
    margin: 0;
}

.new-chat-btn {
    background: var(--reseda-green);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.new-chat-btn:hover {
    background: var(--reseda-test);
    transform: scale(1.1);
}

.chat-list {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.chat-main {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.chat-welcome {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: #666;
    text-align: center;
}

.chat-welcome i {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: var(--reseda-green);
}

/* Friends Page */
.friends-container {
    margin-top: 2rem;
}

.friends-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.friends-header h2 {
    color: var(--reseda-green);
    margin-bottom: 1.5rem;
}

.friends-tabs {
    display: flex;
    gap: 1rem;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn.active,
.tab-btn:hover {
    background: var(--reseda-green);
    color: white;
    border-color: var(--reseda-green);
}

.friends-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.tab-content {
    display: none;
}

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

.friends-grid,
.discover-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

/* Profile Page */
.profile-container {
    margin-top: 2rem;
}

.profile-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.profile-cover {
    height: 200px;
    background: linear-gradient(135deg, var(--reseda-green) 0%, var(--dim-gray) 100%);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.edit-cover-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

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

.profile-info {
    padding: 2rem;
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    position: relative;
}

.profile-avatar-container {
    position: relative;
    margin-top: -60px;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid white;
    object-fit: cover;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.edit-avatar-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    background: var(--reseda-green);
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.edit-avatar-btn:hover {
    background: var(--reseda-test);
}

.profile-details {
    flex: 1;
}

.profile-details h2 {
    color: #333;
    margin-bottom: 0.5rem;
}

.profile-details p {
    color: #666;
    margin-bottom: 0.5rem;
}

.profile-slogan {
    font-style: italic;
    margin-bottom: 1.5rem !important;
}

.profile-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--reseda-green);
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
}

.edit-profile-btn {
    background: var(--reseda-green);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.edit-profile-btn:hover {
    background: var(--reseda-test);
    transform: translateY(-2px);
}

.profile-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Loading Spinner */
.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top: 5px solid var(--reseda-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.modal-content {
    padding: 2rem;
}

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

.modal-content label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.modal-content input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.modal-content input:focus {
    outline: none;
    border-color: var(--reseda-green);
    box-shadow: 0 0 0 3px rgba(63, 81, 181, 0.1);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

.btn-primary,
.btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--reseda-green);
    color: white;
}

.btn-primary:hover {
    background: var(--reseda-test);
}

.btn-secondary {
    background: #f0f0f0;
    color: #666;
}

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

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 100px;
    right: 2rem;
    z-index: 9999;
}

.toast {
    background: white;
    border-radius: 10px;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border-left: 4px solid var(--reseda-green);
    animation: slideIn 0.3s ease;
}

.toast.error {
    border-left-color: #e74c3c;
}

.toast.success {
    border-left-color: #27ae60;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .navbar {
        padding: 1rem;
    }
    
    .nav-menu {
        flex-direction: column;
        gap: 1rem;
    }
    
    .main-app {
        padding: 1rem;
        margin-top: 140px;
    }
    
    .home-container {
        grid-template-columns: 1fr;
    }
    
    .chat-container {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .friends-grid,
    .discover-grid {
        grid-template-columns: 1fr;
    }
    
    .profile-info {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-avatar-container {
        align-self: center;
    }
    
    .auth-card {
        padding: 2rem;
        margin: 1rem;
    }
}

@media (max-width: 480px) {
    .nav-menu {
        gap: 0.5rem;
    }
    
    .nav-link {
        padding: 0.25rem 0.5rem;
        font-size: 0.9rem;
    }
    
    .post-actions {
        flex-direction: column;
    }
    
    .modal {
        width: 95%;
        margin: 1rem;
    }
}

/* Profile Posts Placeholder */
.profile-posts-placeholder {
    text-align: center;
    padding: 3rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.profile-posts-placeholder i {
    font-size: 3rem;
    color: var(--mint-cream);
    margin-bottom: 1rem;
}

.profile-posts-placeholder h3 {
    color: var(--reseda-green);
    margin-bottom: 0.5rem;
}

.profile-posts-placeholder p {
    color: #666;
}

/* Friends and Discover Placeholders */
.friends-placeholder,
.requests-placeholder,
.discover-placeholder {
    text-align: center;
    padding: 3rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    grid-column: 1 / -1;
}

.friends-placeholder i,
.requests-placeholder i,
.discover-placeholder i {
    font-size: 3rem;
    color: var(--mint-cream);
    margin-bottom: 1rem;
}

.friends-placeholder h3,
.requests-placeholder h3,
.discover-placeholder h3 {
    color: var(--reseda-green);
    margin-bottom: 0.5rem;
}

.friends-placeholder p,
.requests-placeholder p,
.discover-placeholder p {
    color: #666;
}

/* Chat Placeholders */
.no-chats {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.no-chats i {
    font-size: 3rem;
    color: var(--mint-cream);
    margin-bottom: 1rem;
}

.no-chats p {
    margin: 0.5rem 0;
}

/* Request Time Styling */
.request-time {
    color: var(--reseda-green) !important;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Enhanced User Status Colors */
.user-status {
    border-radius: 12px;
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: white !important;
}

/* Improved Card Hover Effects */
.user-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(63, 81, 181, 0.15);
}

/* Profile Stats Enhancement */
.profile-stats .stat {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.profile-stats .stat:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}

/* Enhanced Buttons */
.btn-secondary {
    background: var(--light-mint-cream);
    color: var(--reseda-green);
    border: 1px solid var(--mint-cream);
}

.btn-secondary:hover {
    background: var(--mint-cream);
    color: white;
}

/* Post Actions Enhancement */
.post-action-btn:hover {
    background: rgba(63, 81, 181, 0.1);
    color: var(--reseda-green);
}

/* Improved Typography */
.user-card h4 {
    color: var(--dim-gray);
    font-weight: 600;
}

.user-card p {
    color: var(--light-celadon);
}

/* Enhanced Gradients */
.auth-container {
    background: linear-gradient(135deg, var(--lightest-mint-cream) 0%, var(--light-mint-cream) 100%);
}

/* Improved Focus States */
input:focus, textarea:focus {
    border-color: var(--cambridge-blue) !important;
    box-shadow: 0 0 0 3px rgba(92, 107, 192, 0.1) !important;
}

/* Loading States */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Additional Mobile Responsive Enhancements */
@media (max-width: 768px) {
    .friends-placeholder,
    .requests-placeholder,
    .discover-placeholder,
    .profile-posts-placeholder {
        padding: 2rem 1rem;
    }
    
    .friends-placeholder h3,
    .requests-placeholder h3,
    .discover-placeholder h3,
    .profile-posts-placeholder h3 {
        font-size: 1.2rem;
    }
    
    .friends-placeholder i,
    .requests-placeholder i,
    .discover-placeholder i,
    .profile-posts-placeholder i {
        font-size: 2rem;
    }
    
    .user-card-actions {
        flex-direction: column;
    }
    
    .user-card-actions button {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
} 