/* In your styles.css, the body should look like this */
body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f9;
    margin: 0;
    /* This padding is important for the fixed header */
    padding-top: 80px;
    padding-bottom: 40px;
    color: #333;
}

/* And the header should have 'position: fixed' */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 100;
}

.upload-container {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
}

h1 {
    font-size: 1.8em;
    margin-bottom: 10px;
    color: #333;
}

p {
    font-size: 1em;
    color: #666;
}

.drop-zone {
    border: 2px dashed #ddd;
    border-radius: 10px;
    padding: 30px;
    margin: 20px 0;
    transition: background-color 0.3s, border-color 0.3s;
    cursor: pointer;
}

.drop-zone.dragging {
    border-color: #007bff;
    background-color: #f0f8ff;
}

#fileInfo {
    margin: 15px 0;
    font-size: 1em;
    font-weight: bold;
    color: #555;
}

progress {
    width: 100%;
    height: 12px;
    margin: 20px 0;
    border-radius: 6px;
    -webkit-appearance: none;
    appearance: none;
}

progress::-webkit-progress-bar {
    background-color: #eee;
    border-radius: 6px;
}

progress::-webkit-progress-value {
    background-color: #28a745;
    border-radius: 6px;
    transition: width 0.1s linear;
}

.buttons button {
    padding: 12px 25px;
    margin: 5px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s;
}

#uploadButton {
    background-color: #007bff;
    color: #fff;
}

#uploadButton:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

#cancelButton {
    background-color: #dc3545;
    color: white;
}

.custom-file-button {
    display: inline-block;
    background-color: #007bff;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    border: none;
    margin-top: 10px;
}

.custom-file-button:hover {
    background-color: #0056b3;
}

#uploadStatus {
    margin-top: 20px;
    font-size: 1em;
}

.success-message {
    background-color: #e9f7ef;
    border: 1px solid #13a452;
    padding: 15px;
    border-radius: 5px;
    margin-top: 20px;
}

.success-message strong {
    display: block;
    margin-bottom: 10px;
    color: #13a452;
}

.success-message input {
    width: calc(100% - 20px);
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    font-size: 0.9em;
}

.error-message {
    color: #dc3545;
    font-weight: bold;
}

/* New styles for the shareable link and copy button */
.success-message .link-container {
    display: flex;
    align-items: center;
    gap: 8px; /* Adds a small space between the input and the button */
    margin-top: 5px;
}

.success-message input {
    flex-grow: 1; /* Makes the input field take up the available space */
    width: auto;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 10px;
    font-size: 1em;
    background-color: #f8f9fa;
}

.copy-button {
    padding: 10px 15px;
    border: none;
    background-color: #007bff;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s ease-in-out;
    flex-shrink: 0; /* Prevents the button from shrinking */
}

.copy-button:hover {
    background-color: #0056b3;
}

/* Style for the button after the link has been copied */
.copy-button.copied {
    background-color: #28a745; /* Green for success */
}

/* New styles for the selected file list */
#fileInfo h3 {
    margin: 15px 0 5px 0;
    font-size: 1.1em;
    color: #444;
    text-align: left;
}

.file-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
    max-height: 150px; /* Limit the height for long lists */
    overflow-y: auto;  /* Add a scrollbar if the list is too long */
    border: 1px solid #ddd;
    border-radius: 5px;
    text-align: left;
    font-size: 0.9em;
    background-color: #f8f9fa;
}

.file-list li {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Add '...' for very long filenames */
}

.file-list li:last-child {
    border-bottom: none;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}
.nav-link {
    color: #333;
    text-decoration: none;
    font-weight: bold;
    padding: 8px 12px;
    border-radius: 5px;
    transition: background-color 0.2s;
}
.nav-link:hover, .nav-link.active {
    background-color: #f0f2f5;
}
.register-button {
    padding: 8px 15px;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
}
.register-button:hover {
    background-color: #0056b3;
}
.logout-button {
    background-color: #dc3545;
}
.logout-button:hover {
    background-color: #c82333;
}

/* --- Styles for Benefits Section --- */
.benefits-container {
    max-width: 900px;
    margin: 40px auto 0 auto;
    text-align: center;
    padding: 20px;
}
.benefits-container h2 {
    font-size: 24px;
    margin-bottom: 30px;
    color: #333;
}
.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}
.benefit-item {
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    text-align: left;
}
.benefit-item h3 {
    margin-top: 0;
    font-size: 18px;
}
.benefit-item p {
    font-size: 15px;
    line-height: 1.6;
    color: #555;
}

/* Styles for new upload options */
.upload-options {
    display: flex;
    gap: 20px;
    margin: 20px 0;
    text-align: left;
}
.option-group {
    flex: 1;
}
.option-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 0.9em;
}
.option-group input, .option-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

/* --- New Preview Styles --- */
.preview-container {
    padding: 20px;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.preview-container img,
.preview-container video {
    max-width: 100%;
    max-height: 50vh; /* Limit height to 50% of the viewport height */
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.preview-container audio {
    width: 100%;
}

.no-preview {
    text-align: center;
    color: #6c757d;
}
.no-preview p {
    font-size: 18px;
    margin: 0;
}
.no-preview span {
    font-size: 24px;
    font-weight: bold;
    color: #adb5bd;
}

.text-preview {
    width: 100%;
    text-align: left;
}
.text-preview pre {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    white-space: pre-wrap; /* Wrap long lines of text */
    word-wrap: break-word;
    max-height: 250px;
    overflow-y: auto;
    font-family: monospace;
}
.text-preview button {
    margin-top: 10px;
}