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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

.form-card,
.messages-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 30px;
}

h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 600;
    font-size: 0.9rem;
}

input[type="text"],
input[type="time"],
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #667eea;
}

textarea {
    resize: vertical;
    font-family: inherit;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.messages-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.filter-buttons {
    display: flex;
    gap: 10px;
}

.btn-filter {
    padding: 8px 16px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.btn-filter:hover {
    border-color: #667eea;
}

.btn-filter.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
}

.message-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message-item {
    display: flex;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    transition: all 0.3s;
}

.message-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateX(4px);
}

.message-item.inactive {
    opacity: 0.6;
    border-left-color: #ccc;
}

.message-time {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
    min-width: 80px;
    text-align: center;
}

.message-content {
    flex: 1;
    padding: 0 20px;
}

.message-content h3 {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 5px;
}

.message-content p {
    color: #666;
    font-size: 0.95rem;
}

.message-meta {
    margin-top: 8px;
    display: flex;
    gap: 8px;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    background: #e0e0e0;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #555;
}

.badge-sound {
    background: #fff3cd;
    color: #856404;
}

.message-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 6px;
    background: #e0e0e0;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s;
}

.btn-icon:hover {
    background: #667eea;
    color: white;
    transform: scale(1.1);
}

.btn-delete:hover {
    background: #dc3545;
    color: white;
}

/* CSV Upload Styles */
.csv-upload-section {
    margin-top: 10px;
}

.help-text {
    color: #666;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.csv-format-info {
    margin-bottom: 20px;
}

.csv-format-info details {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
}

.csv-format-info summary {
    font-weight: 600;
    color: #667eea;
    user-select: none;
}

.csv-format-info pre {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px;
    margin: 10px 0;
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.5;
}

.csv-format-info p {
    margin: 10px 0 5px 0;
    color: #555;
    font-size: 0.9rem;
}

.csv-format-info .format-note {
    color: #667eea;
    font-weight: 600;
    margin-top: 8px;
}

.file-input-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.file-input-wrapper input[type="file"] {
    display: none;
}

.file-input-wrapper label {
    margin: 0;
    cursor: pointer;
}

.file-name {
    color: #667eea;
    font-weight: 600;
    font-size: 0.9rem;
}

.upload-progress {
    margin-top: 15px;
    padding: 12px;
    background: #e7f3ff;
    border-left: 4px solid #667eea;
    border-radius: 6px;
}

.upload-progress p {
    color: #333;
    font-size: 0.9rem;
    margin: 0;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

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

    .message-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .message-time {
        margin-bottom: 10px;
    }

    .message-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 10px;
    }

    .file-input-wrapper {
        flex-direction: column;
        align-items: flex-start;
    }
}
