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

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

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

h1 {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.control-panel {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.group-input-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.group-input-section label {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.input-row {
    display: flex;
    gap: 10px;
}

#groupName {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

#groupName:focus {
    outline: none;
    border-color: #667eea;
}

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

.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-success {
    background: #48bb78;
    color: white;
}

.btn-success:hover {
    background: #38a169;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.4);
}

.btn-danger {
    background: #f56565;
    color: white;
}

.btn-danger:hover {
    background: #e53e3e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 101, 101, 0.4);
}

.btn-mic {
    background: #ed8936;
    color: white;
    width: 100%;
    padding: 16px;
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.btn-mic:hover {
    background: #dd6b20;
    transform: translateY(-2px);
}

.btn-mic.listening {
    background: #e53e3e;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(229, 62, 62, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(229, 62, 62, 0);
    }
}

.btn-remove {
    background: #fc8181;
    color: white;
    padding: 6px 12px;
    font-size: 0.85rem;
    margin-top: 5px;
}

.btn-remove:hover {
    background: #f56565;
}

.groups-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-bottom: 30px;
}

.group-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.group-card:hover {
    transform: translateY(-2px);
}

.group-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 600;
}

.group-header .count {
    background: rgba(255, 255, 255, 0.3);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.group-content {
    padding: 20px;
}

.group-content .btn-mic {
    margin-bottom: 15px;
}

.current-input {
    background: #f7fafc;
    border: 2px dashed #cbd5e0;
    padding: 12px 15px;
    border-radius: 8px;
    min-height: 40px;
    margin-bottom: 15px;
    font-size: 1rem;
    color: #666;
    font-style: italic;
}

.dorsales-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.dorsal-item {
    background: #edf2f7;
    border: 2px solid #cbd5e0;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    color: #2d3748;
    word-break: break-all;
    position: relative;
}

.dorsal-item:hover {
    background: #e2e8f0;
    border-color: #a0aec0;
}

.dorsal-item.new {
    animation: slideIn 0.3s ease-out;
    background: #c6f6d5;
    border-color: #9ae6b4;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #48bb78;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s;
    font-weight: 600;
    z-index: 1000;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification.error {
    background: #f56565;
}

.empty-state {
    text-align: center;
    color: #a0aec0;
    padding: 30px 20px;
    font-style: italic;
}

/* Mobile optimizations */
@media (max-width: 600px) {
    h1 {
        font-size: 2rem;
    }

    .input-row {
        flex-direction: column;
    }

    .dorsales-list {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    }

    .group-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}
