* {
    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;
    color: #333;
}


/* Prevent background scroll when modal is open */
body.modal-open {
    overflow: hidden;
}

/* Navigation Menu Styles */
.nav-menu {
    background: rgba(255,255,255,0.95);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1500;
    margin-bottom: 20px;
}

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

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.nav-logo:hover {
    transform: scale(1.05);
}

.nav-logo img {
    height: 1.2em;
    width: auto;
    vertical-align: middle;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 25px;
}

.nav-link {
    color: #2c3e50;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    padding: 8px 16px;
    border-radius: 20px;
    position: relative;
}

.nav-link:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.nav-link.active {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    padding: 5px;
    position: relative;
    width: 30px;
    height: 30px;
    justify-content: center;
    align-items: center;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: #2c3e50;
    border-radius: 3px;
    transition: all 0.3s ease;
    position: absolute;
}

.menu-toggle span:nth-child(1) {
    top: 6px;
}

.menu-toggle span:nth-child(2) {
    top: 13.5px;
}

.menu-toggle span:nth-child(3) {
    top: 21px;
}

.menu-toggle.active span:nth-child(1) {
    top: 13.5px;
    transform: rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    top: 13.5px;
    transform: rotate(-45deg);
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 67px;
        left: 0;
        right: 0;
        background: rgba(255,255,255,0.98);
        flex-direction: column;
        padding: 20px;
        gap: 15px;
        box-shadow: 0 8px 20px rgba(0,0,0,0.1);
        transform: translateY(-100%);
        transition: transform 0.3s ease, opacity 0.3s ease;
        opacity: 0;
        max-height: calc(100vh - 67px);
        overflow-y: auto;
        pointer-events: none;
    }

    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .nav-link {
        width: 100%;
        text-align: center;
        padding: 12px 20px;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    padding-bottom: 100px; /* Extra space for infinite scroll */
}
.header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
    position: relative;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.header h1:hover {
    transform: scale(1.05);
}

.auth-container {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    gap: 10px;
    align-items: center;
}

.auth-btn {
    background: rgba(255,255,255,0.9);
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    color: #333;
}

.auth-btn:hover {
    background: white;
    transform: translateY(-2px);
}

.user-info {
    color: white;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #667eea;
    font-weight: bold;
}
/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    /* Enable scrolling within the modal */
    overflow-y: auto;
}

.modal-content {
    background: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease-out;
    /* Ensure modal content can scroll if needed */
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-content.large {
    max-width: 800px;
    margin: 5% auto;
    max-height: 90vh;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #2c3e50;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: 600;
}

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.form-group select {
    background: white;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-submit {
    width: 100%;
    padding: 12px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.form-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.modal-switch {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.modal-switch a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

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

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    margin-top: -10px;
}

.close:hover {
    color: #333;
}

/* WebAuthn/Passkeys Button Styles */
.passkey-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 10px 0;
}

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

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

.passkey-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
    color: #999;
    font-size: 14px;
}

.passkey-divider::before,
.passkey-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #ddd;
}

.passkey-register-section {
    margin: 20px 0;
    padding: 15px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.passkey-register-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
    font-weight: 600;
}

.passkey-loading {
    display: inline-block;
    animation: passkeySpin 1s linear infinite;
}

@keyframes passkeySpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.passkey-icon {
    font-size: 18px;
}
.error-message {
    color: #e74c3c;
    text-align: center;
    margin-top: 10px;
    font-size: 14px;
}

.success-message {
    color: #27ae60;
    text-align: center;
    margin-top: 10px;
    font-size: 14px;
}

.search-bar {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.search-container {
    display: flex;
    background: rgba(255,255,255,0.9);
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: relative;
}

.autocomplete-container {
    position: relative;
    flex: 1;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    padding: 12px 20px;
    border: none;
    font-size: 16px;
    width: 100%;
    outline: none;
    background: transparent;
    z-index: 2;
    position: relative;
}

.search-suggestion {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 12px 20px;
    font-size: 16px;
    color: #999;
    pointer-events: none;
    z-index: 1;
    white-space: nowrap;
    overflow: hidden;
}

.suggestion-prefix {
    color: transparent;
}

.suggestion-suffix {
    color: #999;
    font-weight: normal;
}

.search-type-select {
    padding: 12px 15px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    background: rgba(255,255,255,0.95);
    color: #333;
    cursor: pointer;
    outline: none;
    border-right: 1px solid rgba(0,0,0,0.1);
    min-width: 120px;
}

.search-type-select:focus {
    background: white;
}

.search-btn {
    padding: 12px 20px;
    border: none;
    background: rgba(255,255,255,0.9);
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    border-left: 1px solid rgba(0,0,0,0.1);
}

.search-btn:hover {
    background: white;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.btn {
    background: rgba(255,255,255,0.9);
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
}

.btn:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

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

.btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.add-deal {
    background: linear-gradient(45deg, #ff7f50, #ff4500);
    color: white;
    font-weight: 700;
    font-size: 18px;
    padding: 14px 32px;
    border-radius: 30px;
    box-shadow: 0 6px 25px rgba(255, 69, 0, 0.5);
    transition: all 0.3s ease;
}

.add-deal:hover {
    background: linear-gradient(45deg, #ff4500, #ff6347);
    transform: translateY(-4px);
    box-shadow: 0 10px 40px rgba(255, 69, 0, 0.7);
}

.add-deal:active {
    transform: translateY(-2px);
}

.add-deal:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.clickable-badge {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.clickable-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.deal-store.clickable-badge:hover {
    background: #2980b9;
}

.deal-category.clickable-badge:hover {
    background: #8e44ad;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .header {
        position: relative;
    }

    .auth-container {
        position: static;
        justify-content: center;
        margin-bottom: 15px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .deals-grid {
        grid-template-columns: 1fr;
    }

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

    .search-container {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
    }

    .search-input {
        width: 100%;
    }

    .search-type-select {
        border-right: none;
        border-bottom: 1px solid rgba(0,0,0,0.1);
        border-radius: 0;
    }

    .search-btn {
        border-left: none;
        border-top: 1px solid rgba(0,0,0,0.1);
        border-radius: 0;
    }

    .btn {
        min-width: 200px;
    }

    .add-deal-fab {
        bottom: 80px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }

    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }

    .modal-content {
        margin: 5% auto;
        padding: 20px;
    }

    .modal-content.large {
        margin: 2% auto;
        padding: 15px;
    }

    /* Updated mobile deal actions - keep buttons inline */
    .deal-actions {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
        flex-wrap: nowrap;
    }

    /* Make View Deal button not full width on mobile */
    .deal-link {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 8px 16px;
        font-size: 14px;
    }

    /* Adjust report button container for mobile */
    .deal-actions > div:last-child {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-shrink: 0;
    }

    /* Smaller owner action buttons on mobile */
    .deal-owner-actions {
        gap: 6px;
    }

    .deal-action-btn {
        padding: 4px 8px;
        font-size: 11px;
    }

    /* Smaller report button on mobile */
    .report-btn {
        padding: 4px 8px;
        font-size: 11px;
    }
}


.deals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.deal-card {
    background: rgba(255,255,255,0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

.deal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff6b6b, #feca57, #48cae4, #5f27cd);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.deal-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.deal-card:hover::before {
    transform: scaleX(1);
}

/* Expired Deal Styles */
.deal-card.expired {
    opacity: 0.7;
    background: rgba(255,255,255,0.95);
    border: 1px solid rgba(149, 165, 166, 0.5);
}

.deal-card.expired::before {
    background: #95a5a6;
}

.deal-card.expired .deal-title {
    color: #7f8c8d;
}

.deal-card.expired .deal-price {
    color: #95a5a6;
}

.deal-card.expired .deal-store {
    background: #95a5a6;
}

.deal-card.expired .deal-category {
    background: #95a5a6;
}

.deal-card.expired .deal-link {
    background: linear-gradient(45deg, #95a5a6, #7f8c8d);
    opacity: 0.8;
}

.deal-card.expired .deal-link:hover {
    transform: none;
    box-shadow: none;
}

.email-registered-modal .modal-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    animation: iconBounce 0.6s ease-out;
}

@keyframes iconBounce {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.email-registered-modal h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 24px;
}

.email-registered-modal .modal-message {
    color: #555;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 30px;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-primary {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    width: 100%;
    padding: 14px 24px;
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.btn-secondary:active {
    transform: translateY(0);
}

.expired-badge {
    background: #e74c3c;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 8px;
}


.deal-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: #2c3e50;
    line-height: 1.4;
}

.deal-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: #27ae60;
    margin-bottom: 8px;
}

.deal-store {
    background: #3498db;
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.deal-category {
    background: #9b59b6;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-block;
    font-size: 0.8rem;
    margin-bottom: 8px;
    margin-left: 8px;
}

.deal-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 15px;
}

.deal-likes {
    display: flex;
    align-items: center;
    gap: 5px;
}

.like-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
    padding: 5px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    gap: 5px;
}

.like-btn:hover {
    background: rgba(231, 76, 60, 0.1);
    transform: scale(1.1);
}

.like-btn.liked {
    color: #e74c3c;
}

.like-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.like-btn:disabled:hover {
    transform: none;
    background: none;
}

.like-count {
    background: #e74c3c;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    min-width: 25px;
    text-align: center;
}

.comment-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: all 0.3s ease;
    padding: 5px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 3px;
}

.comment-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.comment-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.deal-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.deal-owner-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.deal-action-btn {
    background: none;
    border: 1px solid #ddd;
    padding: 6px 12px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.deal-action-btn.edit {
    color: #667eea;
    border-color: #667eea;
}

.deal-action-btn.edit:hover {
    background: #667eea;
    color: white;
}

.deal-action-btn.delete {
    color: #e74c3c;
    border-color: #e74c3c;
}

.deal-action-btn.delete:hover {
    background: #e74c3c;
    color: white;
}

.deal-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.deal-owner-badge {
    background: #667eea;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 8px;
}

.deal-link {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}

.deal-link:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Report Deal Styles */
.report-btn {
    background: none;
    border: 1px solid #e74c3c;
    color: #e74c3c;
    padding: 6px 12px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.report-btn:hover {
    background: #e74c3c;
    color: white;
}

.report-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.report-dropdown {
    position: relative;
    display: inline-block;
    margin-left: auto;
}

.report-dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: white;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 8px;
    padding: 8px 0;
    border: 1px solid #ddd;
    bottom: 100%;
    margin-bottom: 5px;
}

.report-dropdown-content.show {
    display: block;
}

.report-option {
    color: #333;
    padding: 8px 16px;
    text-decoration: none;
    display: block;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.3s ease;
}

.report-option:hover {
    background-color: #f5f5f5;
}

.reported-badge {
    background: #95a5a6;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 8px;
}

/* Comments Section Styles */
.comments-section {
    max-height: 60vh;
    overflow-y: auto;
    margin-bottom: 20px;
}

.comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

.comments-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2c3e50;
}

.add-comment-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.add-comment-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

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

.comment-form {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 10px;
    display: none;
}

.comment-form.active {
    display: block;
}

.comment-textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 10px;
}

.comment-textarea:focus {
    outline: none;
    border-color: #667eea;
}

.comment-form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.comment-form-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.comment-form-btn.primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

.comment-form-btn.secondary {
    background: #e0e0e0;
    color: #666;
}

.comment-form-btn:hover {
    transform: translateY(-1px);
}

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

.comments-list {
    space-y: 15px;
}

.comment-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #667eea;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.comment-author {
    font-weight: 600;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-author-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.comment-date {
    font-size: 0.85rem;
    color: #666;
}

.comment-content {
    color: #444;
    line-height: 1.5;
    margin-bottom: 10px;
}

.comment-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.comment-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    color: #666;
    transition: color 0.3s ease;
    padding: 4px 8px;
    border-radius: 4px;
}

.comment-action-btn:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.comment-action-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.no-comments {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 30px;
}

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

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin: 0 auto 20px;
}

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

.status-message {
    text-align: center;
    color: white;
    font-size: 1.1rem;
    margin: 20px 0;
    padding: 15px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.error {
    background: rgba(231, 76, 60, 0.8);
}

.cache-info {
    text-align: center;
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

/* Infinite scroll loading indicator */
.scroll-loading {
    text-align: center;
    padding: 30px 0;
    color: rgba(255,255,255,0.8);
    font-size: 1rem;
    display: none;
}

.scroll-loading.active {
    display: block;
}

.scroll-loading .spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin: 0 auto 15px;
}

.end-message {
    text-align: center;
    padding: 30px 0;
    color: rgba(255,255,255,0.6);
    font-size: 1rem;
    display: none;
}

.end-message.active {
    display: block;
}

/* Floating Action Buttons - Shared Styles */
.floating-btn {
    position: fixed;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    font-size: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

/* Add Deal Floating Button - Always Visible */
.add-deal-fab {
    bottom: 100px; /* Position above back-to-top button */
    right: 30px;
    opacity: 1; /* Always visible */
    transform: translateY(0); /* Always in position */
}

/* Back to Top Button - Show/Hide on Scroll */
.back-to-top {
    bottom: 30px;
    right: 30px;
    opacity: 0;
    transform: translateY(20px);
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}


@media (max-width: 768px) {
    .header {
        position: relative;
    }

    .auth-container {
        position: static;
        justify-content: center;
        margin-bottom: 15px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .deals-grid {
        grid-template-columns: 1fr;
    }

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

    .search-container {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
    }

    .search-input {
        width: 100%;
    }

    .search-type-select {
        border-right: none;
        border-bottom: 1px solid rgba(0,0,0,0.1);
        border-radius: 0;
    }

    .search-btn {
        border-left: none;
        border-top: 1px solid rgba(0,0,0,0.1);
        border-radius: 0;
    }

    .btn {
        min-width: 200px;
    }

    .add-deal-fab {
        bottom: 80px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }

    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }

    .modal-content {
        margin: 5% auto;
        padding: 20px;
    }

    .modal-content.large {
        margin: 2% auto;
        padding: 15px;
    }

    /* Updated mobile deal actions - keep buttons inline */
    .deal-actions {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
        flex-wrap: nowrap;
    }

    /* Make View Deal button not full width on mobile */
    .deal-link {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 8px 16px;
        font-size: 14px;
    }

    /* Adjust report button container for mobile */
    .deal-actions > div:last-child {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-shrink: 0;
    }

    /* Smaller owner action buttons on mobile */
    .deal-owner-actions {
        gap: 6px;
    }

    .deal-action-btn {
        padding: 4px 8px;
        font-size: 11px;
    }

    /* Smaller report button on mobile */
    .report-btn {
        padding: 4px 8px;
        font-size: 11px;
    }
}