html {
    overflow-y: scroll;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #fff;
    background: linear-gradient(90deg, #00008B 0%, #008080 100%);
    text-align: center;
}

body.dark-mode {
    background: linear-gradient(90deg, #333333 0%, #1a1a1a 100%);
}

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

header {
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 2px;
}

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

.logo-area {
    display: flex;
    align-items: center;
    gap: 20px;
}

#theme-toggle-btn {
    background-color: transparent; /* Make background transparent */
    color: #fff; /* White icon color for light mode */
    padding: 5px 10px;
    border: 1px solid rgba(255, 255, 255, 0.5); /* Semi-transparent white border */
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    font-size: 20px; /* Adjusted font size for Unicode character */
    display: inline-flex; /* To center icon vertically */
    align-items: center;
    justify-content: center;
    line-height: 1; /* Ensure consistent vertical alignment */
}

body.dark-mode #theme-toggle-btn {
    background-color: transparent; /* Keep transparent in dark mode */
    color: #eee; /* Light grey icon color in dark mode */
    border-color: rgba(255, 255, 255, 0.3); /* Slightly less transparent white border */
}

body.dark-mode #theme-toggle-btn {
    background-color: transparent; /* Keep transparent in dark mode */
    color: #eee; /* Light grey icon color in dark mode */
    border-color: rgba(255, 255, 255, 0.3); /* Slightly less transparent white border */
}

body.dark-mode #theme-toggle-btn {
    background-color: #444; /* Darker background in dark mode */
    color: #eee; /* Lighter icon color in dark mode */
    border-color: #666;
}

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

nav a {
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.notification-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: red;
    border-radius: 50%;
    margin-left: 5px; /* Adjust as needed */
}

.hero {
    padding: 100px 0;
}

.slogan {
    font-size: 18px;
    letter-spacing: 3px;
    opacity: 0.8;
}

.hero h1 {
    font-size: 60px;
    margin: 20px 0;
    letter-spacing: 15px;
    font-weight: 300;
}

.hero-buttons {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

#logged-in-hero-buttons, #logged-out-hero-buttons {
    display: flex;
    gap: 20px; /* Добавляем промежуток между кнопками */
}

.btn {
    background: transparent;
    border: 1px solid #333; /* Темная рамка для светлой темы */
    color: #333; /* Темный текст для светлой темы */
    padding: 15px 30px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

body.dark-mode .btn {
    border: 1px solid #fff; /* Белая рамка для темной темы */
    color: #fff; /* Белый текст для темной темы */
}

.btn:hover {
    background: #333; /* Темный фон при наведении для светлой темы */
    color: #fff; /* Белый текст при наведении для светлой темы */
}

body.dark-mode .btn:hover {
    background: #fff; /* Белый фон при наведении для темной темы */
    color: #000; /* Черный текст при наведении для темной темы */
}

.hero-buttons .btn {
    border: 1px solid #fff; /* Белый контур для светлой темы */
    color: #fff; /* Белый текст для светлой темы */
}

.hero-buttons .btn:hover {
    background: #fff; /* Белый фон при наведении для светлой темы */
    color: #000; /* Черный текст при наведении для светлой темы */
}

.services {
    padding: 60px 0;
    background: #fff;
    color: #333;
}

body.dark-mode .services {
    background: #2a2a2a;
    color: #eee;
}

.services .container {
    display: flex;
    justify-content: space-around;
}

.service-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.service-item i {
    font-size: 40px;
    color: #888;
}

body.dark-mode .service-item i {
    color: #bbb;
}

.service-item p {
    font-size: 14px;
    font-weight: bold;
}

.service-item.active i {
    color: #e74c3c;
}

body.dark-mode .service-item.active i {
    color: #e74c3c;
}

.about {
    padding: 80px 0;
    background: #fff;
    color: #333;
}

body.dark-mode .about {
    background: #2a2a2a;
    color: #eee;
}

.about-text {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-text h2 {
    font-size: 24px;
    margin-bottom: 20px;
}

#about-description {
    text-align: left;
    margin-top: 20px;
}

.about-text p {
    line-height: 1.6;
}

.details-link {
    grid-column: 1 / -1;
    text-align: center;
    margin-top: 20px;
    color: #888;
    text-decoration: none;
    font-weight: bold;
}

body.dark-mode .details-link {
    color: #bbb;
}

footer {
    padding: 60px 0;
}

.contacts h2 {
    font-size: 24px;
    letter-spacing: 5px;
    margin-bottom: 40px;
}

.contact-items {
    display: flex;
    justify-content: center;
    gap: 80px;
    margin-bottom: 60px;
}

.contact-item i {
    font-size: 30px;
    margin-bottom: 15px;
}

.contact-item p {
    margin: 5px 0;
    font-weight: bold;
}

.contact-item span {
    font-size: 14px;
    opacity: 0.7;
}

.contact-link {
    text-decoration: none;
    color: inherit;
}

.footer-logo i {
    font-size: 80px;
    margin-bottom: 20px;
}

.copyright {
    font-size: 14px;
    opacity: 0.7;
    margin: 10px 0 5px 0;
}

.footer-note {
    font-size: 12px;
    opacity: 0.5;
    margin: 0;
}

/* Modal Styles */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; 
    background-color: rgba(0,0,0,0.6);
}

.modal-content {
    background-color: #fff; /* Светлый фон для светлой темы */
    margin: 15% auto;
    padding: 40px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 10px;
    position: relative;
    color: #333; /* Темный текст для светлой темы */
}

body.dark-mode .modal-content {
    background-color: #222; /* Темный фон для темной темы */
    color: #fff; /* Белый текст для темной темы */
}

.modal-content h2 {
    color: #333; /* Темный текст для светлой темы */
}

body.dark-mode .modal-content h2 {
    color: #fff; /* Белый текст для темной темы */
}

.close-btn {
    color: #aaa;
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 28px;
    font-weight: bold;
}

.close-btn:hover,
.close-btn:focus {
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}

.hidden {
    display: none !important;
}

#login-form, #register-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#login-form input, #register-form input {
    padding: 15px;
    font-size: 16px;
    background: #eee; /* Светлый фон для светлой темы */
    border: 1px solid #ccc; /* Светлая рамка для светлой темы */
    color: #333; /* Темный текст для светлой темы */
    border-radius: 10px;
}

body.dark-mode #login-form input, body.dark-mode #register-form input {
    background: #333; /* Темный фон для темной темы */
    border: 1px solid #555; /* Темная рамка для темной темы */
    color: #fff; /* Белый текст для темной темы */
}

.form-message {
    margin-top: 10px;
}

.form-message.success {
    color: #000000;
}

.form-message.error {
    color: red;
}

.form-toggle {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.toggle-btn {
    background: none;
    border: none;
    color: #666; /* Темный текст для светлой темы */
    font-size: 18px;
    padding: 10px 20px;
    cursor: pointer;
}

body.dark-mode .toggle-btn {
    color: #888; /* Серый текст для темной темы */
}

.toggle-btn.active {
    color: #333; /* Темный текст для активной кнопки в светлой теме */
    border-bottom: 2px solid #333; /* Темная нижняя граница для активной кнопки в светлой теме */
}

body.dark-mode .toggle-btn.active {
    color: #fff; /* Белый текст для активной кнопки в темной теме */
    border-bottom: 2px solid #fff; /* Белая нижняя граница для активной кнопки в темной теме */
}

/* Cabinet Page Styles */
.cabinet-section {
    background: #ffffff;
    color: #000000;
    padding: 30px;
    border-radius: 10px;
    margin-top: 40px;
    text-align: left;
    overflow-x: auto;
}

.cabinet-section a {
    color: #007bff;
}

body.dark-mode .cabinet-section {
    background: rgba(0, 0, 0, 0.3); /* Darker background for dark mode */
    color: #eee; /* Lighter text color */
}

#orders-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

#orders-table th, #orders-table td {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

#orders-table th {
    text-align: left;
}

#order-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

#order-form label {
    text-align: left;
    font-weight: bold;
}

#order-form input, #order-form select {
    padding: 10px;
    font-size: 16px;
    background: #fff;
    border: 1px solid #ccc;
    color: #333;
    border-radius: 10px;
}

body.dark-mode #order-form input, body.dark-mode #order-form select {
    background: #333;
    border: 1px solid #555;
    color: #fff;
}

#order-form button {
    padding: 12px 20px;
    font-size: 16px;
    cursor: pointer;
}

#order-form .btn {
    border-color: #000000;
    color: #000000;
    background-color: #ffffff;
}

#order-form .btn:hover {
    background: #000000;
    color: #ffffff;
}

#password-form {
    display: flex;
    flex-direction: column;
    gap: 15px; /* Space between label-input pairs */
}

#password-form label {
    text-align: left;
    font-weight: bold;
    margin-bottom: 5px; /* Space between label and input */
}

#password-form input[type="password"] {
    padding: 10px;
    font-size: 16px;
    background: #fff;
    border: 1px solid #ccc;
    color: #333;
    border-radius: 10px;
    width: 100%;
    box-sizing: border-box;
}

body.dark-mode #password-form input[type="password"] {
    background: #333;
    border: 1px solid #555;
    color: #fff;
}

#password-form .btn {
    border-color: #fff;
    color: #fff;
}

#password-form .btn:hover {
    background: #fff;
    color: #333;
}

/* --- Responsive Styles --- */
@media (max-width: 768px) {
    /* Header */
            header .container {
                flex-direction: column;
                gap: 20px;
            }
    
            .logo-area {
                position: relative;
                width: 100%;
                display: flex;
                justify-content: center;
                align-items: center;
            }
    
            #theme-toggle-btn {
                position: absolute;
                left: 0;
            }
    nav ul {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    /* Hero Section */
    .hero h1 {
        font-size: 36px;
        letter-spacing: 5px;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    /* Services Section */
    .services .container {
        flex-direction: column;
        gap: 30px;
    }

    /* About Section */
    .about-text {
        grid-template-columns: 1fr;
        text-align: center;
    }

    /* Contacts Section */
    .contact-items {
        flex-direction: column;
        gap: 40px;
    }

    /* Modal */
    .modal-content {
        width: 90%;
        margin: 20% auto;
        padding: 20px;
    }

    /* Tables */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch; /* For smooth scrolling on iOS */
    }

    #orders-table {
        width: 100%; /* Ensure table takes full width of its container */
        min-width: 600px; /* Set a minimum width for the table to prevent squishing */
    }

    #orders-table th,
    #orders-table td {
        padding: 10px 8px;
        font-size: 14px;
    }

    /* Cabinet/Forms */
    .cabinet-section {
        padding: 20px;
    }
}

/* Order Cards Styles */
.orders-grid {
    display: block;
}

.orders-header {
    display: grid;
    grid-template-columns: 0.5fr 2.5fr 2fr 1fr 1fr 1fr 2fr;
    gap: 20px;
    font-weight: bold;
    padding-bottom: 10px;
    border-bottom: 1px solid #dddddd;
    margin-bottom: 10px;
    min-width: 800px;
    align-items: center;
}

.order-row {
    display: grid;
    grid-template-columns: 0.5fr 2.5fr 2fr 1fr 1fr 1fr 2fr;
    gap: 20px;
    padding: 10px 0;
    border-bottom: 1px solid #dddddd;
    align-items: center; /* Vertically center items in the row */
    min-width: 800px;
}

.order-header-item,
.order-item {
    text-align: center; /* Horizontally center text */
    word-break: break-word; /* Wrap long words/links */
    min-width: 0; /* Allow shrinking */
}

.order-item a {
    word-break: break-all; /* Break long links */
}

/* Prevent wrapping in the Status column */
.order-row .order-item:nth-child(6),
.orders-header .order-header-item:nth-child(6) {
    white-space: nowrap;
    min-width: min-content;
}


.order-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px 20px;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.order-header {
    display: flex;
    align-items: center;
    gap: 20px;
    font-weight: bold;
}

.order-details {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.order-id {
    font-size: 1.1em;
}

.order-status {
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-pending {
    background-color: #ffc107;
    color: #333;
}

.status-in-progress {
    border: 1px solid #17a2b8; /* Blue border */
    background-color: transparent; /* Transparent background */
    color: #17a2b8; /* Blue text */
}

.status-completed {
    background-color: #28a745;
    color: #fff;
}

.status-cancelled {
    background-color: #dc3545;
    color: #fff;
}

.status-unknown {
    background-color: #6c757d;
    color: #fff;
}

.order-details p {
    margin: 5px 0;
    font-size: 0.95em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.order-details p i {
    color: #bbb;
    width: 20px;
    text-align: center;
}

.order-details a {
    color: #87CEEB;
    text-decoration: none;
    word-break: break-all;
}

.order-details a:hover {
    text-decoration: underline;
}

/* Responsive adjustments for order cards */
@media (max-width: 768px) {
    .orders-grid {
        grid-template-columns: 1fr;
    }
}

/* New Service Card Styles */
#services-list-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.service-item-card {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    color: #333;
    text-align: left;
}

body.dark-mode .service-item-card {
    background-color: #333;
    color: #eee;
}

.service-card-top, .service-card-bottom {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.service-card-top {
    border-bottom: 1px solid #dddddd;
}

.service-id {
    background-color: #3498db;
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    font-weight: bold;
}

.service-name {
    font-weight: bold;
    flex-grow: 1;
    margin-left: 15px;
}

.service-price {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
}

.service-price .price-unit {
    background-color: #f0f0f0;
    padding: 5px;
    border-radius: 3px;
}

body.dark-mode .service-price .price-unit {
    background-color: #555;
    color: #eee;
}

.service-details {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.detail-item {
    background-color: #f0f0f0;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

body.dark-mode .detail-item {
    background-color: #555;
    color: #eee;
}

.detail-item.time { background-color: #fde2e2; color: #c0392b; }
body.dark-mode .detail-item.time {
    background-color: #773333; /* Darker red */
    color: #ffaaaa;
}

.detail-item.refill { background-color: #e2f5e2; color: #27ae60; }
body.dark-mode .detail-item.refill {
    background-color: #337733; /* Darker green */
    color: #aaffaa;
}

.detail-item.speed { background-color: #e2eafc; color: #2980b9; }
body.dark-mode .detail-item.speed {
    background-color: #333377; /* Darker blue */
    color: #aaaaff;
}

.service-actions {
    display: flex;
    gap: 10px;
}

.btn-description, .btn-buy {
    padding: 10px 20px;
    border-radius: 5px;
    border: 1px solid #ccc;
    background-color: #fff;
    cursor: pointer;
    font-weight: bold;
}

body.dark-mode .btn-description {
    background-color: #555;
    color: #eee;
    border-color: #777;
}

.btn-buy {
    background-color: #3498db;
    color: #fff;
    border-color: #3498db;
}

/* Filter Bar Styles */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 15px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-bar label {
    font-weight: bold;
}

.filter-bar input[type="text"] {
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #ccc;
    background-color: #fff;
    color: #333;
}

body.dark-mode .filter-bar input[type="text"] {
    background-color: #333;
    border-color: #555;
    color: #fff;
}

#status-filter {
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #ccc;
    background-color: #fff;
    color: #333;
}

body.dark-mode #status-filter {
    background-color: #333;
    border-color: #555;
    color: #fff;
}

/* Admin Orders Page Styles */
.admin-orders-header, .admin-order-row {
    grid-template-columns: 80px 1.5fr 2.5fr 2fr 100px 100px 120px 1.5fr;
}

/* Admin Chats Page Styles */
.admin-chats-header, .admin-chat-row {
    grid-template-columns: 100px 250px 1fr 180px;
}

.status-changer {
    padding: 5px;
    border-radius: 5px;
    border: 1px solid #ccc;
    background-color: #fff;
    color: #333;
}

body.dark-mode .status-changer {
    background-color: #333;
    border-color: #555;
    color: #fff;
}

.user-filter-bar {
    justify-content: flex-start;
}

/* Style for unread chat rows */
.order-row.unread {
    background-color: #e6f7ff; /* A light blue color */
    font-weight: bold;
}

body.dark-mode .order-row.unread {
    background-color: #2a3a4a; /* A darker blue for dark mode */
}
