body, html {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    background-color: black;
    color: white;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

* {
    box-sizing: border-box;
}

/* Header and Navigation */
header {
    background-color: black;
    padding: 1em 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

nav {
    display: flex;
    justify-content: space-between;
    width: 90%;
    max-width: 1200px;
    align-items: center;
}

.left-nav, .right-nav {
    display: flex;
    align-items: center;
}

.left-nav .logo {
    margin-right: 2em;
}

nav .logo a {
    text-decoration: none;
    color: white;
}

nav ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

nav ul li {
    margin: 0 1em;
}

nav ul li a {
    color: white;
    text-decoration: none;
    padding: 0.5em 1em;
    transition: background-color 0.3s;
}

nav ul li a:hover {
    background-color: #333;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown .dropbtn {
    background-color: black;
    color: white;
    padding: 0.5em 1em;
    border: none;
    cursor: pointer;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #333;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
}

.dropdown-content a {
    color: white;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}

.dropdown-content a:hover {
    background-color: #444;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown:hover .dropbtn {
    background-color: #444;
}

#profile-menu img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

/* Hero Section */
.hero {
    color: white;
    text-align: center;
    padding: 5em 1em;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 70vh;
}

.home-hero {
    background: url('https://images.pexels.com/photos/13162139/pexels-photo-13162139.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2') no-repeat center center/cover;
}

.hero-content {
    max-width: 800px;
}

.hero h1 {
    font-size: 3em;
    margin: 0;
}

.hero p {
    font-size: 1.5em;
    margin: 1em 0;
}

.hero button {
    background-color: #f39c12;
    color: black;
    border: none;
    padding: 1em 2em;
    font-size: 1em;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.hero button:hover {
    background-color: #e67e22;
}

/* Categories Section */
.categories {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 2em;
    flex-grow: 1;
}

.category {
    background-color: black;
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(255, 255, 255, 0.1);
    margin: 1em;
    padding: 1em;
    text-align: center;
    width: calc(25% - 2em);
    transition: transform 0.3s, box-shadow 0.3s;
}

.category:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(255, 255, 255, 0.2);
}

.category img {
    width: 100px;
    height: 100px;
    margin-bottom: 1em;
    filter: invert(1); /* Invert image colors */
}

.category h2 {
    margin-top: 0.5em;
}

.category p {
    color: #ccc;
}

.btn {
    background-color: white;
    color: black;
    padding: 0.5em 1em;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s, color 0.3s;
}

.btn:hover {
    background-color: #f39c12;
    color: black;
}

/* Form Section - Signup/Login */
.form-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background-color: black;
    color: white;
    padding: 2em;
}

.form-container {
    background-color: #222;
    padding: 2em 3em;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(255, 255, 255, 0.1);
    max-width: 400px;
    width: 100%;
    text-align: center;
}

form {
    width: 100%;
}

form h1 {
    font-size: 2em;
    margin-bottom: 1em;
    color: #f39c12;
}

label {
    display: block;
    text-align: left;
    font-size: 1em;
    margin: 0.5em 0 0.2em;
    color: #ccc;
}

input, button {
    width: 100%;
    padding: 0.8em;
    margin-bottom: 1em;
    border: none;
    border-radius: 4px;
    font-size: 1em;
}

input {
    background-color: #333;
    color: white;
    border: 1px solid #555;
    transition: border-color 0.3s;
}

input:focus {
    border-color: #f39c12;
    outline: none;
}

button {
    background-color: #f39c12;
    color: black;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #e67e22;
}

p {
    font-size: 0.9em;
    color: #ccc;
}

p a {
    color: #f39c12;
    text-decoration: none;
    transition: color 0.3s;
}

p a:hover {
    color: #e67e22;
}

/* Footer */
footer {
    background-color: #000;
    color: white;
    text-align: center;
    padding: 0.5em 0;
    width: 100%;
    margin-top: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .category {
        width: calc(50% - 2em);
    }
}

@media (max-width: 480px) {
    .category {
        width: calc(100% - 2em);
    }

    .hero h1 {
        font-size: 2em;
    }

    .hero p {
        font-size: 1.2em;
    }

    nav ul {
        flex-direction: column;
        align-items: flex-start;
    }

    .left-nav, .right-nav {
        flex-direction: column;
        align-items: flex-start;
    }

    nav ul li {
        margin: 0.5em 0;
    }
}
/* Chat Section */
.chat-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: black;
    padding: 2em;
}

.chat-container {
    background-color: #222;
    width: 90%;
    max-width: 800px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(255, 255, 255, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 80%;
}

.chat-header {
    background-color: #333;
    color: #f39c12;
    padding: 1em;
    text-align: center;
    font-size: 1.5em;
    font-weight: bold;
}

.chat-messages {
    flex-grow: 1;
    padding: 1em;
    overflow-y: auto;
    color: white;
}

.message {
    margin-bottom: 1em;
}

.message.user {
    text-align: right;
    color: #f39c12;
}

.message.bot {
    text-align: left;
    color: #ccc;
}

.chat-footer {
    background-color: #333;
    padding: 1em;
    display: flex;
    gap: 1em;
    align-items: center;
}

.chat-footer input {
    flex-grow: 1;
    padding: 0.8em;
    border: none;
    border-radius: 4px;
    background-color: #555;
    color: white;
}

.chat-footer input:focus {
    outline: none;
    border: 1px solid #f39c12;
}

.chat-footer button {
    background-color: #f39c12;
    color: black;
    border: none;
    padding: 0.8em 1.5em;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.chat-footer button:hover {
    background-color: #e67e22;
}



/* PWA-specific styles */
.pwa-mode {
    margin: 0;
    padding: 0;
}

/* PWA display mode styles */
@media (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
    
    .browser-only {
        display: none;
    }
}

/* Network status indicator styles */
#network-status.online {
    background-color: #2ecc71;
    color: white;
    opacity: 0.8;
}

#network-status.offline {
    background-color: #e74c3c;
    color: white;
    opacity: 1;
    animation: pulse 1s infinite;
}

/* Hide install button when PWA is already installed */
.pwa-installed .pwa-install-button {
    display: none !important;
}

/* Loading states for offline functionality */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f39c12;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive PWA styles */
@media (max-width: 768px) {
    .pwa-mode {
        font-size: 16px;
    }
}

/* Dark mode support for PWA */
@media (prefers-color-scheme: dark) {
    .pwa-mode {
        background-color: #000;
        color: #fff;
    }
}
