/* --- Font Imports --- */
/* For general UI elements */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* --- Global Body & Base Styling --- */
body {
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif; /* Modern, readable font */
    margin: 0;
    padding: 0;
    background-color: #0A0A0A; /* Deep black background for consistency */
    color: #E0E0E0; /* Off-white for general text */
    line-height: 1.6;
    min-height: 100vh; /* Ensure body covers full viewport height */
    display: flex;
    flex-direction: column; /* For overall page layout */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Global Header Section (consistent across app) --- */
header {
    background: linear-gradient(160deg, #1A1A1A 0%, #0A0A0A 100%); /* Dark, subtle gradient */
    color: white;
    padding: 25px 25px 20px; /* Adjusted padding */
    text-align: left;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    position: sticky; /* Make header sticky */
    top: 0;
    z-index: 990;
    border-bottom: 1px solid #282828;
    display: flex; /* Use flexbox for header content */
    justify-content: space-between; /* Space out title and right buttons */
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    gap: 15px; /* Gap for wrapped items */
}

header h1 {
    margin: 0;
    font-size: 2.2em; /* Larger, more impactful title */
    font-weight: 700;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
    letter-spacing: -0.8px;
    flex-grow: 1; /* Allow title to take available space */
}

/* Header Navigation (specific to this page, integrated into global header) */
header nav {
    margin-top: 0; /* Align with other header elements */
    display: flex;
    justify-content: center;
    gap: 12px; /* Adjusted gap */
    flex-wrap: wrap;
}

header nav a {
    color: #E0E0E0; /* Off-white for nav links */
    text-decoration: none;
    font-size: 1.1em; /* Slightly larger */
    font-weight: 500;
    padding: 8px 15px; /* Added padding for clickable area */
    border-radius: 8px; /* Rounded corners */
    transition: all 0.3s ease;
}

header nav a:hover {
    color: white; /* White on hover */
    background-color: #1A1A1A; /* Darker background on hover */
    transform: translateY(-2px); /* Subtle lift */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

header nav a.active {
    color: white;
    background-color: #2E8B57; /* Kinema+ Green for active link */
    box-shadow: 0 2px 8px rgba(46, 139, 87, 0.4);
}

/* --- Global Top-Right Buttons (Profile, Share, Notification) --- */
.top-right-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-left: auto; /* Push to the right if space allows */
}

.icon-btn {
    background: linear-gradient(to bottom right, #1A1A1A, #0A0A0A);
    border: 1px solid #282828;
    padding: 12px;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0; /* Prevent shrinking on small screens */
}

.icon-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.5);
    background: linear-gradient(to bottom right, #2E8B57, #246B44); /* Kinema+ Green on hover */
}
.icon-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4) inset;
}

.icon-btn img {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1); /* Makes icon white */
}
.icon-btn:hover img {
    filter: brightness(100%) invert(0); /* Removes filter to show original (white) */
}

/* User profile button in top right */
#profileBtn img {
    width: 38px; /* Slightly larger for profile */
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #2E8B57; /* Kinema+ Green border for prominence */
    box-shadow: 0 0 0 2px #1A1A1A; /* Inner dark shadow */
    transition: transform 0.2s ease;
}
#profileBtn img:hover {
    transform: scale(1.05); /* Slight scale on hover */
}

/* --- Main Workspace Container --- */
.workspace-container {
    max-width: 900px;
    margin: 30px auto 100px auto; /* Margin for bottom nav */
    padding: 30px; /* Increased padding */
    background-color: #111111; /* Dark background for main content area */
    border-radius: 18px; /* More rounded */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); /* Deeper shadow */
    border: 1px solid #282828; /* Subtle border */
    flex-grow: 1; /* Allows main content to fill available space */
}

section {
    margin-bottom: 40px; /* More space between sections */
    padding: 30px; /* Increased padding */
    border: 1px solid #282828; /* Darker, subtle border */
    border-radius: 15px; /* More rounded */
    background-color: #1C1C1E; /* Dark gray for sections */
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3); /* Deeper shadow */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

section:hover {
    transform: translateY(-8px); /* Subtle lift on hover */
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.45); /* Enhanced shadow on hover */
}

section h2 {
    color: #FFFFFF; /* Pure white for section titles */
    font-size: 2.2em; /* Larger, more prominent titles */
    margin-top: 0;
    margin-bottom: 30px;
    text-align: left; /* Align left for modern look */
    border-bottom: 3px solid #2E8B57; /* Kinema+ Green border */
    padding-bottom: 15px;
    font-weight: 700;
    position: relative;
}

section h2::after { /* Small accent under title */
    content: '';
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 60px;
    height: 4px;
    background-color: #2E8B57; /* Kinema+ Green accent */
    border-radius: 2px;
}

form label {
    display: block;
    margin-bottom: 10px; /* More space */
    font-weight: 600;
    color: #A0A0A0; /* Softer gray */
}

form input[type="text"],
form input[type="email"],
form textarea {
    width: calc(100% - 24px); /* Adjusted for padding */
    padding: 12px;
    margin-bottom: 18px; /* More space */
    border: 1px solid #3A3A3A; /* Darker border */
    border-radius: 8px; /* Rounded input */
    font-size: 1em;
    box-sizing: border-box;
    background-color: #222222; /* Dark background */
    color: #E0E0E0; /* Off-white text */
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

form input[type="text"]::placeholder,
form input[type="email"]::placeholder,
form textarea::placeholder {
    color: #777; /* Softer placeholder color */
}

form input[type="text"]:focus,
form input[type="email"]:focus,
form textarea:focus {
    outline: none;
    border-color: #2E8B57; /* Kinema+ Green on focus */
    box-shadow: 0 0 0 3px rgba(46, 139, 87, 0.3); /* Green glow on focus */
}

form button {
    background-color: #2E8B57; /* Kinema+ Green */
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 30px; /* Fully rounded button */
    cursor: pointer;
    font-size: 1.05em;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

form button:hover {
    background-color: #246B44; /* Darker Kinema+ Green on hover */
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}
form button:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4) inset;
    background-color: #1A5432;
}

.projects-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px; /* More gap */
}

.project-card {
    background-color: #1A1A1A; /* Dark background */
    border: 1px solid #282828;
    border-radius: 15px; /* More rounded */
    padding: 20px; /* More padding */
    box-shadow: 0 6px 20px rgba(0,0,0,0.35); /* Deeper shadow */
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px); /* More pronounced lift */
    box-shadow: 0 10px 25px rgba(0,0,0,0.45); /* Enhanced shadow on hover */
}

.project-card h3 {
    margin-top: 0;
    color: #FFFFFF; /* White title for projects */
    font-size: 1.4em;
    margin-bottom: 10px;
    border-bottom: 1px solid #2E8B57; /* Kinema+ Green accent */
    padding-bottom: 8px;
}

.project-card p {
    margin-bottom: 10px; /* More space */
    font-size: 0.95em;
    color: #A0A0A0; /* Softer gray */
}

.project-card .actions {
    display: flex;
    gap: 12px; /* More space */
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px dashed #444; /* Darker dashed border */
}

.project-card button {
    background-color: #222222; /* Dark button background */
    color: #E0E0E0; /* Off-white text */
    border: 1px solid #3A3A3A; /* Subtle border */
    padding: 10px 15px; /* More padding */
    border-radius: 8px; /* Rounded corners */
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    flex-grow: 1; /* Allow stretching */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.project-card button:hover {
    background-color: #2E8B57; /* Kinema+ Green on hover */
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}
.project-card button:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) inset;
    background-color: #246B44;
}

.project-card button.collaborate-btn {
    background-color: #4C3C24; /* Darker orange/brown */
    border-color: #7A602B;
    color: #FFD700; /* Gold text */
}
.project-card button.collaborate-btn:hover {
    background-color: #6B5532;
    border-color: #9A7C4B;
    color: white;
}

/* Messages d'information */
.loading-message, .no-content-message {
    text-align: center;
    color: #A0A0A0; /* Softer gray */
    font-style: italic;
    margin-top: 25px;
    padding: 20px;
    background-color: #1A1A1A; /* Dark background */
    border-radius: 12px;
    border: 1px solid #282828;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.hidden {
    display: none !important;
}

/* Modale pour l'invitation de collaborateurs */
.modal {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    z-index: 1001; /* Above everything */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.7); /* Darker overlay */
    backdrop-filter: blur(5px); /* Subtle blur effect */
}

.modal-content {
    background-color: #1A1A1A; /* Dark background */
    margin: auto;
    padding: 30px; /* More padding */
    border: 1px solid #282828;
    width: 80%;
    max-width: 550px; /* Slightly wider */
    border-radius: 18px; /* More rounded */
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6); /* Deeper shadow */
}

.modal-content h3 {
    color: #FFFFFF; /* White title */
    margin-top: 0;
    border-bottom: 2px solid #2E8B57; /* Kinema+ Green border */
    padding-bottom: 15px;
    margin-bottom: 25px;
    font-size: 1.8em;
    font-weight: 700;
}

.modal-content .close-button {
    color: #E0E0E0; /* Off-white close button */
    font-size: 32px; /* Larger close button */
    font-weight: bold;
    position: absolute;
    top: 15px;
    right: 25px;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
}

.modal-content .close-button:hover,
.modal-content .close-button:focus {
    color: #FF7070; /* Light red on hover */
    transform: rotate(90deg); /* Small rotation on hover */
    text-decoration: none;
}

.current-collaborators h4 {
    margin-top: 20px;
    margin-bottom: 8px;
    color: #A0A0A0; /* Softer gray */
    font-size: 1.1em;
    font-weight: 600;
}

#currentCollaboratorsList {
    list-style: none;
    padding: 0;
    margin-bottom: 25px;
}

#currentCollaboratorsList li {
    background-color: #222222; /* Dark background */
    color: #E0E0E0; /* Off-white text */
    padding: 10px 15px; /* More padding */
    margin-bottom: 8px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #3A3A3A;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
}

#currentCollaboratorsList li .remove-collaborator-btn {
    background-color: #5C2D2F; /* Darker red */
    color: #FF7070; /* Light red text */
    border: 1px solid #7F3C3F;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

#currentCollaboratorsList li .remove-collaborator-btn:hover {
    background-color: #7F3E41;
    color: white;
}

.message {
    padding: 12px;
    border-radius: 8px;
    margin-top: 20px;
    text-align: center;
    font-weight: bold;
    font-size: 0.95em;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.message.success { background-color: #1A5432; color: #8BC34A; border: 1px solid #2E8B57; } /* Dark green with green text */
.message.error { background-color: #7F3C3F; color: #FF7070; border: 1px solid #dc3545; } /* Dark red with red text */

/* --- Global Bottom Navigation --- */
footer {
    text-align: center;
    padding: 25px; /* More padding */
    margin-top: auto; /* Pushes footer to the bottom */
    background-color: #111111; /* Dark background */
    color: #A0A0A0; /* Softer gray text */
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.4); /* Deeper shadow */
    border-top: 1px solid #282828; /* Subtle top border */
    font-size: 0.95em;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #111111; /* Dark background */
    display: flex;
    justify-content: space-around;
    padding: 12px 0;
    z-index: 999;
    box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.4);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    border-top: 1px solid #282828;
}

.bottom-nav .nav-item {
    color: #888888; /* Muted gray for inactive items */
    text-align: center;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 12px;
    padding: 8px 5px;
    border-radius: 12px;
    transition: all 0.3s ease;
    flex-grow: 1;
    max-width: 90px;
}

.bottom-nav .nav-item img {
    filter: invert(70%); /* Grayish filter for inactive icons */
    margin-bottom: 5px;
    width: 26px;
    height: 26px;
    transition: filter 0.3s ease;
}

.bottom-nav .nav-item span {
    font-size: 0.9em;
    font-weight: 500;
}

.bottom-nav .nav-item:hover {
    background-color: #1A1A1A; /* Darker background on hover */
    color: #E0E0E0;
    transform: translateY(-3px);
}
.bottom-nav .nav-item:hover img {
    filter: invert(100%);
}

.bottom-nav .nav-item.active {
    background-color: #2E8B57; /* Kinema+ Green for active item */
    color: #fff;
    transform: translateY(-5px);
    box-shadow: 0 -5px 15px rgba(46, 139, 87, 0.3);
}
.bottom-nav .nav-item.active img {
    filter: invert(0%) brightness(100%);
}


/* --- Responsive Adjustments --- */
@media (max-width: 992px) {
    header {
        padding: 20px;
    }
    header h1 {
        font-size: 2em;
    }
    header nav {
        gap: 10px;
    }
    header nav a {
        padding: 7px 12px;
        font-size: 1em;
    }
    .top-right-buttons {
        gap: 10px;
    }
    .icon-btn {
        width: 45px;
        height: 45px;
        padding: 10px;
    }
    .icon-btn img {
        width: 22px;
        height: 22px;
    }
    #profileBtn img {
        width: 35px;
        height: 35px;
    }

    .workspace-container {
        padding: 25px;
        margin: 25px auto 90px auto;
    }
    section {
        padding: 25px;
        margin-bottom: 35px;
    }
    section h2 {
        font-size: 2em;
        margin-bottom: 25px;
        padding-bottom: 12px;
    }
    section h2::after {
        width: 50px;
        height: 3px;
    }
    form input[type="text"],
    form input[type="email"],
    form textarea {
        width: calc(100% - 20px);
        padding: 10px;
        margin-bottom: 15px;
    }
    form button {
        padding: 10px 20px;
        font-size: 1em;
    }
    .projects-list {
        gap: 20px;
    }
    .project-card {
        padding: 18px;
        border-radius: 12px;
    }
    .project-card h3 {
        font-size: 1.3em;
        margin-bottom: 8px;
    }
    .project-card p {
        font-size: 0.9em;
        margin-bottom: 8px;
    }
    .project-card .actions {
        gap: 10px;
        padding-top: 12px;
    }
    .project-card button {
        padding: 9px 14px;
        font-size: 0.85em;
    }
    .modal-content {
        padding: 25px;
        max-width: 500px;
        border-radius: 15px;
    }
    .modal-content h3 {
        font-size: 1.6em;
        padding-bottom: 12px;
        margin-bottom: 20px;
    }
    .modal-content .close-button {
        font-size: 30px;
        top: 12px;
        right: 20px;
    }
    #currentCollaboratorsList li {
        padding: 9px 14px;
        margin-bottom: 6px;
    }
    #currentCollaboratorsList li .remove-collaborator-btn {
        padding: 5px 10px;
        font-size: 0.8em;
    }
    footer {
        padding: 20px;
        font-size: 0.9em;
    }
    .bottom-nav {
        padding: 10px 0;
    }
    .bottom-nav .nav-item {
        font-size: 11px;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }
    header h1 {
        font-size: 1.8em;
        text-align: center;
    }
    header nav {
        width: 100%;
        justify-content: center;
        margin-top: 10px;
    }
    .top-right-buttons {
        position: relative;
        top: auto;
        right: auto;
        margin-top: 15px;
        width: 100%;
        justify-content: center;
    }
    .icon-btn {
        width: 45px;
        height: 45px;
        padding: 10px;
    }
    .icon-btn img {
        width: 22px;
        height: 22px;
    }
    #profileBtn img {
        width: 32px;
        height: 32px;
    }

    .workspace-container {
        padding: 20px;
        margin: 20px 15px 80px 15px;
        border-radius: 12px;
    }
    section {
        padding: 20px;
        margin-bottom: 30px;
        border-radius: 10px;
    }
    section h2 {
        font-size: 1.8em;
        margin-bottom: 20px;
        padding-bottom: 10px;
    }
    section h2::after {
        width: 40px;
        height: 3px;
    }
    form input[type="text"],
    form input[type="email"],
    form textarea {
        width: 100%; /* Full width on mobile */
        padding: 10px;
        font-size: 0.95em;
    }
    form button {
        width: 100%; /* Full width on mobile */
        padding: 10px 15px;
    }
    .projects-list {
        grid-template-columns: 1fr; /* Single column on small screens */
        gap: 15px;
    }
    .project-card {
        padding: 15px;
        border-radius: 10px;
    }
    .project-card h3 {
        font-size: 1.2em;
    }
    .project-card p {
        font-size: 0.85em;
    }
    .project-card .actions {
        gap: 8px;
        padding-top: 10px;
    }
    .project-card button {
        flex-grow: 1; /* Allow buttons to grow */
        width: auto;
        padding: 8px 12px;
        font-size: 0.8em;
    }
    .modal-content {
        width: 90%;
        padding: 20px;
        border-radius: 12px;
    }
    .modal-content h3 {
        font-size: 1.5em;
        padding-bottom: 10px;
        margin-bottom: 15px;
    }
    .modal-content .close-button {
        font-size: 28px;
        top: 10px;
        right: 15px;
    }
    .current-collaborators h4 {
        font-size: 1em;
        margin-top: 15px;
    }
    #currentCollaboratorsList li {
        padding: 8px 12px;
    }
    #currentCollaboratorsList li .remove-collaborator-btn {
        padding: 4px 8px;
        font-size: 0.75em;
    }
    .message {
        padding: 10px;
        font-size: 0.9em;
    }
    footer {
        padding: 15px;
        font-size: 0.85em;
    }
    .bottom-nav {
        padding: 10px 0;
        border-top-left-radius: 15px;
        border-top-right-radius: 15px;
    }
    .bottom-nav .nav-item {
        font-size: 10px;
        padding: 5px 3px;
        max-width: 80px;
    }
    .bottom-nav .nav-item img {
        width: 22px;
        height: 22px;
    }
}

@media (max-width: 480px) {
    header {
        padding: 15px;
    }
    header h1 {
        font-size: 1.5em;
    }
    header nav a {
        padding: 6px 10px;
        font-size: 0.9em;
    }
    .icon-btn {
        width: 40px;
        height: 40px;
        padding: 8px;
    }
    .icon-btn img {
        width: 20px;
        height: 20px;
    }
    #profileBtn img {
        width: 30px;
        height: 30px;
    }

    .workspace-container {
        padding: 15px;
        margin: 15px 10px 70px 10px;
    }
    section {
        padding: 15px;
        margin-bottom: 25px;
    }
    section h2 {
        font-size: 1.6em;
        margin-bottom: 15px;
        padding-bottom: 8px;
    }
    section h2::after {
        width: 30px;
    }
    form label {
        margin-bottom: 6px;
    }
    form input[type="text"],
    form input[type="email"],
    form textarea {
        padding: 8px;
        font-size: 0.9em;
        margin-bottom: 12px;
    }
    form button {
        padding: 10px 15px;
        font-size: 0.95em;
    }
    .projects-list {
        gap: 10px;
    }
    .project-card {
        padding: 12px;
        border-radius: 8px;
    }
    .project-card h3 {
        font-size: 1.1em;
        margin-bottom: 6px;
    }
    .project-card p {
        font-size: 0.8em;
        margin-bottom: 6px;
    }
    .project-card .actions button {
        padding: 6px 10px;
        font-size: 0.75em;
    }
    .modal-content {
        padding: 15px;
        border-radius: 10px;
    }
    .modal-content h3 {
        font-size: 1.3em;
        padding-bottom: 8px;
        margin-bottom: 12px;
    }
    .modal-content .close-button {
        font-size: 24px;
        top: 8px;
        right: 10px;
    }
    .current-collaborators h4 {
        font-size: 0.9em;
        margin-top: 10px;
    }
    #currentCollaboratorsList li {
        padding: 6px 10px;
        font-size: 0.85em;
    }
    #currentCollaboratorsList li .remove-collaborator-btn {
        padding: 3px 6px;
        font-size: 0.7em;
    }
    .message {
        padding: 8px;
        font-size: 0.8em;
    }
    footer {
        padding: 12px;
        font-size: 0.75em;
    }
    .bottom-nav {
        padding: 8px 0;
    }
    .bottom-nav .nav-item {
        font-size: 9px;
        padding: 4px 2px;
    }
    .bottom-nav .nav-item img {
        width: 20px;
        height: 20px;
    }
}
