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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* Auth Banner - Inside Hero */
.auth-banner {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: white;
    padding: 10px 20px;
    text-align: center;
    margin-bottom: 20px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-banner a {
    color: white;
    text-decoration: underline;
    font-weight: bold;
}

.auth-banner a:hover {
    text-decoration: none;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
}

/* User Status Banner - Inside Hero */
.user-status-banner {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: white;
    padding: 10px 20px;
    text-align: center;
    margin-bottom: 20px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-action-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 5px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 10px;
    transition: all 0.3s ease;
}

.hero-action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}



/* User Info Bar */
.user-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

body.index-page .user-bar {
    padding: 10px 20px;
    background-color: white;
    margin-bottom: 0;
}

.user-menu {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

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

.dashboard-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

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

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 60px 0;
    text-align: center;
    margin: -20px -20px 0 -20px;
}

body.index-page .hero-section {
    margin: 0;
}

.hero-subtitle {
    font-size: 18px;
    margin-top: 10px;
    opacity: 0.9;
}

/* Features Section */
.features-section {
    padding: 60px 20px;
    background: white;
}

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

.section-title {
    text-align: center;
    font-size: 32px;
    margin-bottom: 50px;
    color: #2c3e50;
}

.section-subtitle {
    text-align: center;
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
}

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

.feature-card {
    background: white;
    padding: 30px 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

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

.feature-card h3 {
    font-size: 20px;
    margin-bottom: 15px;
    color: #2c3e50;
}

.feature-card p {
    color: #666;
    line-height: 1.5;
}

/* Benefits Section */
.benefits-section {
    padding: 60px 20px;
    background: #f8f9fa;
}

.benefits-comparison {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 800px;
    margin: 0 auto;
}

.benefit-column {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.registered-benefits {
    border: 3px solid #667eea;
    position: relative;
}

.registered-benefits::before {
    content: "RECOMMENDED";
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: #667eea;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.benefit-column h3 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #2c3e50;
    text-align: center;
}

.benefit-column ul {
    list-style: none;
    padding: 0;
}

.benefit-column li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.benefit-column li:last-child {
    border-bottom: none;
}

.cta-buttons {
    margin-top: 30px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn-primary,
.btn-secondary {
    padding: 12px 24px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a67d8;
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
}

/* Generator Section */
.generator-section {
    padding: 60px 20px 40px;
    background: white;
}

/* Form Section for full width */
body.index-page #invoice-form {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

body.index-page #invoice-output {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.save-btn {
    background-color: #27ae60 !important;
}

.save-btn:hover {
    background-color: #219a52 !important;
}

.save-btn:disabled {
    background-color: #95a5a6 !important;
    cursor: not-allowed;
}

/* Logo Upload Styles */
.logo-preview {
    margin-top: 10px;
    text-align: center;
}

.logo-preview img {
    max-width: 200px;
    max-height: 100px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
}

.remove-logo-btn {
    background-color: #e74c3c !important;
    color: white;
    padding: 5px 10px !important;
    font-size: 12px !important;
    margin: 0 !important;
}

.remove-logo-btn:hover {
    background-color: #c0392b !important;
}

/* Profile Tabs */
.profile-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.tab-btn {
    background: none !important;
    border: none !important;
    padding: 10px 20px !important;
    cursor: pointer;
    color: #666 !important;
    border-bottom: 2px solid transparent !important;
    margin: 0 !important;
    transition: all 0.3s;
}

.tab-btn.active {
    color: #3498db !important;
    border-bottom-color: #3498db !important;
}

.tab-btn:hover {
    color: #3498db !important;
    background: none !important;
}

.tab-content {
    display: block;
}

.tab-content.hidden {
    display: none;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    background-color: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    margin-top: 20px;
}

/* Full width container for index page */
body.index-page .container {
    max-width: none;
    margin: 0;
    padding: 0;
    background-color: transparent;
    box-shadow: none;
    border-radius: 0;
    margin-top: 0;
}

/* App Header */
.app-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

.app-logo {
    height: 80px;
    width: auto;
    margin-bottom: 15px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

h1 {
    color: #2c3e50;
    margin: 10px 0 0 0;
}

h2 {
    color: #34495e;
    margin: 20px 0 15px 0;
    font-size: 1.2em;
}

form {
    margin-bottom: 30px;
}

/* Two-column layout for seller and buyer details */
.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.details-column {
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.buyer-selection {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

input[type="text"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

button {
    background-color: #3498db;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin: 10px 5px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #2980b9;
}

#download-pdf {
    background-color: #e74c3c;
}

#download-pdf:hover {
    background-color: #c0392b;
}

#add-item-btn {
    background-color: #27ae60;
}

#add-item-btn:hover {
    background-color: #219a52;
}

.remove-item-btn {
    background-color: #e74c3c !important;
    padding: 8px 16px !important;
}

/* Logo upload styles */
input[type="file"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    background-color: white;
}

.logo-preview {
    margin-bottom: 15px;
    text-align: center;
    padding: 15px;
    border: 2px dashed #ddd;
    border-radius: 4px;
    background-color: #f9f9f9;
}

.logo-preview img {
    max-height: 100px;
    max-width: 200px;
    object-fit: contain;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.remove-logo-btn {
    background-color: #e74c3c !important;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
}

.remove-logo-btn:hover {
    background-color: #c0392b !important;
}

/* Invoice logo styles */
.invoice-logo {
    margin-bottom: 20px;
    text-align: center;
}

.invoice-logo img {
    max-height: 80px;
    max-width: 200px;
    object-fit: contain;
    border: none;
}

.hidden {
    display: none !important;
    font-size: 14px !important;
    margin: 0 !important;
}

.remove-item-btn:hover {
    background-color: #c0392b !important;
}

.hidden {
    display: none;
}

/* Items Section */
.item-row {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 15px;
    background-color: #f9f9f9;
}

.item-fields {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: 15px;
    align-items: end;
}

.field-group {
    display: flex;
    flex-direction: column;
}

.field-group label {
    margin-bottom: 5px;
    font-size: 14px;
}

.item-total {
    background-color: #ecf0f1 !important;
}

/* Totals Section */
.totals-section {
    background-color: #ecf0f1;
    padding: 20px;
    border-radius: 4px;
    margin: 20px 0;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 16px;
}

.gst-breakdown {
    border-top: 1px solid #bdc3c7;
    border-bottom: 1px solid #bdc3c7;
    margin: 10px 0;
    padding: 10px 0;
}

.gst-row {
    color: #7f8c8d;
    font-size: 14px;
    padding: 3px 0;
}

.grand-total {
    border-top: 2px solid #333;
    margin-top: 10px;
    padding-top: 10px;
    font-weight: bold;
    font-size: 18px;
}

#invoice-output {
    background-color: #ecf0f1;
    padding: 20px;
    border-radius: 4px;
    margin-top: 20px;
}

#invoice-details {
    font-size: 16px;
    margin: 10px 0;
    padding: 10px;
    background-color: white;
    border-radius: 4px;
}

.invoice-preview {
    background-color: white;
    padding: 30px;
    margin: 20px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.invoice-header {
    text-align: center;
    border-bottom: 2px solid #333;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.invoice-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.invoice-section {
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.invoice-section h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.items-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.items-table th,
.items-table td {
    padding: 10px;
    text-align: left;
    border: 1px solid #ddd;
}

.items-table th {
    background-color: #f8f9fa;
    font-weight: bold;
}

.items-table .text-right {
    text-align: right;
}

.amount-section {
    text-align: right;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.amount-row {
    display: flex;
    justify-content: space-between;
    margin: 5px 0;
    font-size: 16px;
}

.total-amount {
    font-weight: bold;
    font-size: 18px;
    border-top: 1px solid #333;
    padding-top: 10px;
    margin-top: 10px;
}

/* Logo upload styles */
input[type="file"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    background-color: white;
}

.logo-preview {
    margin-bottom: 15px;
    text-align: center;
    padding: 15px;
    border: 2px dashed #ddd;
    border-radius: 4px;
    background-color: #f9f9f9;
}

.logo-preview img {
    max-height: 100px;
    max-width: 200px;
    object-fit: contain;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.remove-logo-btn {
    background-color: #e74c3c !important;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
}

.remove-logo-btn:hover {
    background-color: #c0392b !important;
}

/* Invoice logo styles */
.invoice-logo {
    margin-bottom: 20px;
    text-align: center;
}

.invoice-logo img {
    max-height: 80px;
    max-width: 200px;
    object-fit: contain;
    border: none;
}

.hidden {
    display: none !important;
}

@media (max-width: 768px) {
    .container {
        margin: 10px;
        padding: 15px;
    }

    .details-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .details-column {
        padding: 15px;
    }

    .invoice-details-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .item-fields {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .totals-section {
        padding: 15px;
    }

    .logo-preview img {
        max-height: 80px;
        max-width: 150px;
    }

    .invoice-logo img {
        max-height: 60px;
        max-width: 150px;
    }

    .clear-details-btn {
        padding: 8px 16px;
        font-size: 12px;
    }
}

/* Clear Seller Details Button */
.clear-details-btn {
    background-color: #f39c12 !important;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 15px;
    width: 100%;
}

.clear-details-btn:hover {
    background-color: #e67e22 !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        padding: 40px 20px;
    }

    .section-title {
        font-size: 24px;
        margin-bottom: 30px;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .benefits-comparison {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .cta-buttons {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        text-align: center;
    }

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

    .invoice-details-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .hero-section {
        margin: -10px -10px 0 -10px;
        padding: 30px 10px;
    }

    body.index-page .hero-section {
        margin: 0;
        padding: 30px 10px;
    }

    body.index-page .user-bar {
        padding: 10px;
    }

    body.index-page #invoice-form {
        padding: 20px 10px;
    }

    .features-section,
    .benefits-section,
    .generator-section {
        padding: 40px 10px;
    }

    .feature-card,
    .benefit-column {
        padding: 20px 15px;
    }

    .feature-icon {
        font-size: 36px;
    }
}