* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    background-color: #f5f5f5;
    padding: 20px;
}

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

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
}

h2 {
    color: #444;
    margin: 20px 0 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

.upload-section, .slideshow-container, .gallery {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

#uploadForm {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

input[type="file"] {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #45a049;
}

#uploadStatus {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
}

.success {
    background-color: #dff0d8;
    color: #3c763d;
}

.error {
    background-color: #f2dede;
    color: #a94442;
}

/* Slideshow Styles */
.slideshow-container {
    width: 100%;
    max-width: 100%;
    margin: 0 0 20px 0;
    padding: 0;
}

#slideshow {
    position: relative;
    width: 100%;
    height: 70vh; /* Use viewport height for better responsiveness */
    min-height: 400px;
    overflow: hidden;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

/* Notes Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    overflow: auto;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 700px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

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

.close-modal {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover,
.close-modal:focus {
    color: black;
    text-decoration: none;
}

/* Notes List */
#notesList {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
    padding-right: 10px;
}

.note-item {
    background-color: #f9f9f9;
    border-left: 4px solid #4CAF50;
    padding: 12px 15px;
    margin-bottom: 10px;
    border-radius: 0 4px 4px 0;
}

.note-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.note-date {
    color: #777;
    font-size: 0.85em;
}

.note-text {
    color: #444;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Add Note Form */
.add-note {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

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

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    margin-top: 5px;
}

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

#saveNoteBtn {
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

#saveNoteBtn:hover {
    background-color: #45a049;
}

#noteStatus {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
}

#noteStatus.success {
    background-color: #dff0d8;
    color: #3c763d;
}

#noteStatus.error {
    background-color: #f2dede;
    color: #a94442;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .modal-content {
        width: 90%;
        margin: 10% auto;
    }
    
    .controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .speed-control {
        width: 100%;
        text-align: center;
    }
    
    #speedInput {
        width: 60px;
    }
}

/* Fullscreen styles */
#slideshow.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100% !important;
    height: 100% !important;
    margin: 0;
    padding: 0;
    z-index: 9999;
    border-radius: 0;
}

.fullscreen #currentImage {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
}

#currentImage {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: none;
    margin: 0 auto;
    object-fit: contain;
}

#noImages {
    color: #999;
    text-align: center;
    padding: 20px;
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.speed-control {
    display: flex;
    align-items: center;
    gap: 5px;
}

.speed-control input {
    width: 50px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Gallery Styles */
#imageGallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.thumbnail {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s;
    border: 2px solid transparent;
}

.thumbnail:hover {
    transform: scale(1.05);
    border-color: #4CAF50;
}

.thumbnail.active {
    border-color: #4CAF50;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    #imageGallery {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .thumbnail {
        height: 120px;
    }
    
    .controls {
        flex-direction: column;
    }
    
    #slideshow {
        height: 300px;
    }
}
