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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #121212;
    min-height: 100vh;
    color: #e0e0e0;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: #1e1e1e;
    margin: 5% auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    animation: slideDown 0.2s ease;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid #333;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content .close {
    color: #999;
    float: right;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 15px;
    transition: color 0.3s ease;
}

.modal-content .close:hover {
    color: #f44336;
}

.modal-content h2 {
    color: #64b5f6;
    margin-bottom: 20px;
    font-size: 1.8em;
    font-weight: 400;
}

#editEventForm {
    margin-top: 20px;
}

#editAuthor,
#editText {
    width: 100%;
    padding: 12px;
    border: 1px solid #444;
    border-radius: 4px;
    font-size: 0.95em;
    font-family: inherit;
    margin-bottom: 12px;
    transition: border-color 0.2s ease;
    background: #252525;
    color: #e0e0e0;
}

#editText {
    resize: vertical;
    min-height: 100px;
}

#editAuthor:focus,
#editText:focus {
    outline: none;
    border-color: #ff6f00;
}

.time-inputs {
    display: flex;
    gap: 15px;
    margin-bottom: 12px;
}

.time-input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.time-input-group label {
    color: #e0e0e0;
    font-size: 0.9em;
    font-weight: 500;
}

.time-input-group input[type="time"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #444;
    border-radius: 4px;
    font-size: 0.95em;
    font-family: inherit;
    transition: border-color 0.2s ease;
    background: #252525;
    color: #e0e0e0;
}

.time-input-group input[type="time"]:focus {
    outline: none;
    border-color: #ff6f00;
}

#editImage {
    display: none;
}

#currentImageContainer {
    margin: 10px 0;
}

#currentImageContainer img {
    display: block;
    max-width: 200px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.submit-btn {
    width: 100%;
    padding: 12px;
    background: #ff6f00;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1em;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 10px;
    box-shadow: 0 2px 8px rgba(255, 111, 0, 0.4);
}

.submit-btn:hover {
    background: #ff8f00;
    box-shadow: 0 4px 12px rgba(255, 111, 0, 0.6);
    transform: translateY(-1px);
}

/* Ekran logowania */
.login-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.login-container {
    background: #1e1e1e;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    width: 90%;
    max-width: 400px;
    border: 1px solid #333;
}

.login-container h1 {
    color: #64b5f6;
    font-size: 2em;
    font-weight: 400;
    margin-bottom: 30px;
    text-align: center;
}

#loginForm {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#adminPassword {
    width: 100%;
    padding: 12px;
    border: 1px solid #444;
    border-radius: 4px;
    font-size: 1em;
    transition: border-color 0.2s ease;
    background: #252525;
    color: #e0e0e0;
}

#adminPassword:focus {
    outline: none;
    border-color: #2196f3;
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: #ff6f00;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1em;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(255, 111, 0, 0.4);
}

.login-btn:hover {
    background: #ff8f00;
    box-shadow: 0 4px 12px rgba(255, 111, 0, 0.6);
    transform: translateY(-1px);
}

.error-message {
    color: #f44336;
    font-size: 0.9em;
    margin-top: 10px;
    text-align: center;
    min-height: 20px;
}

.back-link {
    display: block;
    text-align: center;
    margin-top: 20px;
    color: #999;
    text-decoration: none;
    font-size: 0.9em;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: #64b5f6;
}

/* Panel admina */
.admin-panel {
    min-height: 100vh;
    background: #121212;
}

.admin-header {
    background: #1e1e1e;
    padding: 20px 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.admin-header h1 {
    color: #64b5f6;
    font-size: 1.8em;
    font-weight: 400;
}

.admin-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    padding: 10px 20px;
    background: #ff6f00;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.95em;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(255, 111, 0, 0.4);
    text-decoration: none;
    display: inline-block;
}

.action-btn:hover {
    background: #ff8f00;
    box-shadow: 0 4px 12px rgba(255, 111, 0, 0.6);
    transform: translateY(-1px);
}

.delete-all-btn {
    background: #f44336 !important;
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.4) !important;
}

.delete-all-btn:hover {
    background: #d32f2f !important;
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.6) !important;
}

.delete-selected-btn {
    background: #ff9800 !important;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.4) !important;
}

.delete-selected-btn:hover {
    background: #f57c00 !important;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.6) !important;
}

.header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-content {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.add-event-card {
    background: #1e1e1e;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
    margin-bottom: 20px;
}

.add-event-card h2 {
    color: #64b5f6;
    font-size: 1.5em;
    font-weight: 400;
    margin-bottom: 20px;
}

#addEventForm {
    margin-top: 10px;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 12px;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    color: #e0e0e0;
    font-size: 0.9em;
    font-weight: 500;
}

#addDate,
#addAuthor,
#addText,
.form-group input[type="time"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #444;
    border-radius: 4px;
    font-size: 0.95em;
    font-family: inherit;
    transition: border-color 0.2s ease;
    background: #252525;
    color: #e0e0e0;
}

#addText {
    resize: vertical;
    min-height: 100px;
}

#addDate:focus,
#addAuthor:focus,
#addText:focus,
.form-group input[type="time"]:focus {
    outline: none;
    border-color: #ff6f00;
}

#addImage {
    display: none;
}

.events-list {
    background: #1e1e1e;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
}

.admin-event-item {
    background: #252525;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 1px solid #333;
    border-left: 3px solid #2196f3;
    transition: all 0.2s ease;
}

.event-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    margin-top: 2px;
    flex-shrink: 0;
}

.admin-event-item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    border-color: #444;
}

.admin-event-info {
    flex: 1;
}

.admin-event-info strong {
    color: #64b5f6;
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 1.1em;
}

.admin-event-info p {
    color: #e0e0e0;
    margin-bottom: 8px;
    line-height: 1.6;
}

.admin-event-info .event-author {
    color: #64b5f6;
    font-size: 0.9em;
    margin-bottom: 8px;
    font-weight: 500;
}

.admin-event-info .event-time {
    color: #ffa726;
    font-size: 0.9em;
    margin-bottom: 8px;
    font-weight: 500;
}

.admin-event-info .event-ip {
    color: #81c784;
    font-size: 0.85em;
    margin-bottom: 8px;
    font-weight: 400;
    font-family: 'Courier New', monospace;
}

.admin-event-info img {
    max-width: 200px;
    border-radius: 4px;
    margin-top: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.admin-event-info img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.image-modal {
    max-width: 95%;
    max-height: 95vh;
    padding: 20px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.image-modal img {
    max-width: 100%;
    width: auto;
    height: auto;
    min-width: 200px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    display: block;
}

.event-buttons {
    display: flex;
    gap: 10px;
    margin-left: 15px;
    align-self: flex-start;
}

.edit-btn {
    background: #ff6f00;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(255, 111, 0, 0.4);
}

.edit-btn:hover {
    background: #ff8f00;
    box-shadow: 0 4px 12px rgba(255, 111, 0, 0.6);
    transform: translateY(-1px);
}

.delete-btn {
    background: #f44336;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.4);
}

.delete-btn:hover {
    background: #d32f2f;
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.6);
    transform: translateY(-1px);
}

.events-list > p {
    text-align: center;
    color: #999;
    padding: 20px;
}

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

.events-header h2 {
    color: #64b5f6;
    font-size: 1.5em;
    font-weight: 400;
}

/* Responsywność */
@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .action-btn {
        flex: 1;
        min-width: 120px;
    }

    .admin-event-item {
        flex-direction: column;
    }

    .event-buttons {
        margin-left: 0;
        margin-top: 15px;
        width: 100%;
        flex-direction: column;
    }

    .edit-btn,
    .delete-btn {
        width: 100%;
    }

    .events-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .form-row {
        flex-direction: column;
        gap: 10px;
    }
}
