﻿/* Basic Reset & Body */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    background-color: #f4f7f6;
    color: #333;
}

.container {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Login Page */
.login-container {
    width: 350px;
    margin: 100px auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.login-container h2 {
    text-align: center;
    margin-bottom: 20px;
}
.form-group {
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
}
.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}
button {
    width: 100%;
    padding: 12px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}
button:hover {
    background-color: #0056b3;
}
.error {
    color: #d93025;
    text-align: center;
    margin-bottom: 10px;
}


/* Header & Navigation */
header {
    background-color: #e8f5e9;
    color: #333;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ccc;
    position: relative; /* Important for mobile menu positioning */
}
header .logo img {
    height: 47px;
    width: auto;
    display: block;
}
header nav a {
    color: #333;
    text-decoration: none;
    margin: 0 15px;
    padding: 5px 0;
    border-bottom: 2px solid transparent;
    transition: border-bottom 0.2s;
}
header nav a:hover {
    border-bottom: 2px solid #28a745;
}
.header-right {
    display: flex;
    align-items: center;
}
.user-info {
    font-size: 0.9em;
    white-space: nowrap; /* Prevents user info from wrapping */
}
.logout-btn {
    background-color: #e74c3c;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    text-decoration: none;
    margin-left: 15px;
}
.logout-btn:hover {
    background-color: #c0392b;
}

/* Main Content */
h1 {
    color: #2c3e50;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}
.btn {
    display: inline-block;
    padding: 10px 15px;
    background-color: #28a745;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    margin-bottom: 20px;
}
.btn:hover {
    background-color: #218838;
}

/* Language Switcher Styling */
.language-switcher {
    margin-right: 20px;
    color: #333; /* Sets color for the "|" separators */
}
.language-switcher a {
    color: #333; /* Sets dark color for the links */
    text-decoration: none;
    font-weight: bold;
}
.language-switcher a:hover {
    text-decoration: underline;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}
thead {
    background-color: #c8e6c9;
    color: #333;
}
tbody tr:hover {
    background-color: #f1f1f1;
}

/* Forms */
.crm-form {
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.form-group.full-width {
    grid-column: 1 / -1;
}
.crm-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9em;
    color: #555;
}
.crm-form input[type="text"],
.crm-form input[type="tel"],
.crm-form input[type="url"],
.crm-form input[type="email"],
.crm-form input[type="datetime-local"],
.crm-form input[type="date"],
.crm-form input[type="number"],
.crm-form select,
.crm-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1em;
}
.crm-form textarea {
    resize: vertical;
}
.btn-cancel {
    display: inline-block;
    padding: 10px 15px;
    background-color: #6c757d;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    margin-left: 10px;
}
.btn-cancel:hover {
    background-color: #5a6268;
}
.feedback {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
}
.feedback.success {
    background-color: #dff0d8;
    color: #3c763d;
    border: 1px solid #d6e9c6;
}
.feedback.error {
    background-color: #f2dede;
    color: #a94442;
    border: 1px solid #ebccd1;
}

/* View Page */
.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px 25px;
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.detail-item {
    font-size: 1em;
}
.detail-item strong {
    color: #555;
    margin-right: 8px;
}
.detail-item.full-width {
    grid-column: 1 / -1;
}
.detail-item p {
    margin-top: 5px;
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #eee;
}
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #eee;
    padding-bottom: 5px;
    margin-top: 30px;
}
.section-header h2 {
    margin: 0;
    color: #2c3e50;
}
.btn-small {
    padding: 6px 12px;
    font-size: 0.9em;
    background-color: #17a2b8;
    color: white;
    text-decoration: none;
    border-radius: 4px;
}
.btn-small:hover {
    background-color: #138496;
}

/* ==== RESPONSIVE DESIGN ==== */
#hamburger-btn {
    display: none; /* Hidden on desktop */
    flex-direction: column;
    justify-content: space-around;
    width: 2rem;
    height: 2rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: 1rem;
    z-index: 20;
}
#hamburger-btn .bar {
    width: 2rem;
    height: 0.25rem;
    background-color: #333;
    border-radius: 10px;
    transition: all 0.3s ease-in-out;
}
#hamburger-btn.active .bar:nth-child(1) {
    transform: translateY(11px) rotate(45deg);
}
#hamburger-btn.active .bar:nth-child(2) {
    opacity: 0;
}
#hamburger-btn.active .bar:nth-child(3) {
    transform: translateY(-11px) rotate(-45deg);
}

@media (max-width: 900px) {
    #main-nav {
        display: none; /* Hide the main navigation */
        position: absolute;
        top: 78px; /* Position it below the header */
        left: 0;
        width: 100%;
        flex-direction: column;
        background-color: #f0fdf0;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        border-top: 1px solid #ccc;
        z-index: 10;
    }
    #main-nav.active {
        display: flex; /* Show it when active */
    }
    #main-nav a {
        padding: 1rem;
        text-align: left;
        border-bottom: 1px solid #e0e0e0;
    }

    /* ADD THIS RULE TO FIX THE LAYOUT */
    .header-right {
        margin-left: auto; /* This pushes the container to the far right */
    }

    .user-info {
        display: none; /* Hide the user info on small screens */
    }
    #hamburger-btn {
        display: flex; /* Show the hamburger button */
    }
}

/* --- INVOICE STYLES --- */
.invoice-box {
    max-width: 800px;
    margin: auto;
    padding: 30px;
    border: 1px solid #eee;
    box-shadow: 0 0 10px rgba(0, 0, 0, .15);
    font-size: 16px;
    line-height: 24px;
    font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;
    color: #555;
    background: #fff;
    margin-top: 30px;
}
.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}
.invoice-header h1 {
    color: #333;
    border-bottom: none;
    margin: 0;
    padding: 0;
}
.invoice-parties {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    margin-bottom: 40px;
}
.invoice-box table {
    box-shadow: none;
}
.invoice-box table thead th {
    background: #eee;
    border-bottom: 1px solid #ddd;
    font-weight: bold;
}
.invoice-box table tfoot .total-label {
    text-align: right;
    font-weight: bold;
    font-size: 1.2em;
    border-top: 2px solid #333;
}
.invoice-box table tfoot .total-value {
    text-align: right;
    font-weight: bold;
    font-size: 1.2em;
    border-top: 2px solid #333;
    background: #eee;
}

/* --- PRINT STYLES --- */
@media print {
    body, .container {
        margin: 0;
        padding: 0;
        background: #fff;
        box-shadow: none;
    }
    .no-print, header, .crm-form, .btn {
        display: none !important;
    }
    .invoice-box {
        box-shadow: none;
        border: none;
        max-width: 100%;
        margin: 0;
        padding: 0;
    }
    /* ADDED THESE TWO LINES TO HIDE THE MAIN TITLE AND LINE */
    main.container > h1,
    .invoice-box hr {
        display: none !important;
    }
}