/* WhatsApp Automation System - Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 2em;
    margin-bottom: 10px;
}

.github-link {
    color: white;
    text-decoration: none;
}

.content {
    padding: 30px;
}

.step {
    display: none;
    animation: fadeIn 0.5s;
}

.step.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn {
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 1.1em;
    cursor: pointer;
    transition: transform 0.2s;
    margin: 10px 5px;
}

.btn:hover {
    transform: scale(1.05);
}

.btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
}

.btn-warning {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
}

.btn-success {
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
}

.btn-small {
    padding: 8px 15px;
    font-size: 0.9em;
}

.filter-group {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 10px;
    margin: 15px 0;
    border: 2px solid #e0e0e0;
}

.filter-group h3 {
    margin-bottom: 15px;
    color: #333;
    border-bottom: 1px solid #ddd;
    padding-bottom: 8px;
}

.input-group {
    margin: 15px 0;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.input-group input,
.input-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
}

.input-group textarea {
    min-height: 100px;
    resize: vertical;
}

.status {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #25d366 0%, #128c7e 100%);
    transition: width 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.contact-count {
    font-size: 2em;
    color: #25d366;
    text-align: center;
    margin: 20px 0;
}

.info-box {
    background: #fff3cd;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    border-left: 4px solid #ffc107;
}

.contact-item {
    padding: 8px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contact-item:last-child {
    border-bottom: none;
}

.media-preview-container {
    position: relative;
    display: inline-block;
    margin: 5px;
}

.media-preview {
    max-width: 100px;
    max-height: 100px;
    border-radius: 8px;
    border: 2px solid #ddd;
}

.video-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8em;
    pointer-events: none;
}

.remove-media {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-media:hover {
    background: #d32f2f;
    transform: scale(1.1);
}

.media-preview-container-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0;
    min-height: 50px;
    padding: 10px;
    border: 2px dashed #ddd;
    border-radius: 8px;
}

.media-upload-area {
    margin: 15px 0;
}

.media-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.media-tab {
    padding: 10px 20px;
    background: #f5f5f5;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.media-tab.active {
    background: #25d366;
    color: white;
    border-color: #25d366;
}

.media-tab:hover {
    transform: scale(1.05);
}

.nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

.contact-selection-tools {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    border: 2px solid #e0e0e0;
}

.search-box {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    margin-bottom: 10px;
    font-size: 1em;
}

.contact-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.contact-checkbox {
    margin-right: 10px;
    transform: scale(1.2);
}

.contact-item.selected {
    background: #e8f5e9;
    border-left: 4px solid #25d366;
}

.contact-item.excluded {
    background: #ffebee;
    border-left: 4px solid #f44336;
    opacity: 0.7;
}

.contact-item.excluded .contact-name {
    text-decoration: line-through;
    color: #999;
}

.selection-actions {
    display: flex;
    gap: 10px;
    margin: 10px 0;
}

.show-more-btn {
    text-align: center;
    margin: 10px 0;
}

.contact-name {
    flex: 1;
    margin-right: 10px;
}

.contact-phone {
    font-size: 0.8em;
    color: #666;
    margin-left: 10px;
}

.selection-info {
    background: #e3f2fd;
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
    text-align: center;
}

.contact-list {
    max-height: 400px;
    overflow-y: auto;
    background: #f5f5f5;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #25d366;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Spinner grande para área do QR Code */
.qr-spinner {
    display: inline-block;
    width: 60px;
    height: 60px;
    border: 5px solid #e0e0e0;
    border-top: 5px solid #25d366;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

.summary-content {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    margin: 10px 0;
}

.summary-message {
    background: #f5f5f5;
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
    max-height: 100px;
    overflow-y: auto;
}

.summary-media {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0;
}

.summary-media-item {
    max-width: 80px;
    max-height: 80px;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.time-estimate {
    background: #e8f5e9;
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
    text-align: center;
    font-weight: bold;
}

.upload-section {
    background: #e8f5e9;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    border: 2px dashed #25d366;
    text-align: center;
}

.upload-section h3 {
    color: #128c7e;
    margin-bottom: 15px;
}

.duplicates-warning {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    display: none;
}

.duplicates-warning.show {
    display: block;
}

.duplicates-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.duplicates-text {
    flex: 1;
    text-align: left;
}

.duplicates-text strong {
    color: #f57c00;
    font-size: 1.1em;
}

/* Document Preview Styles */
.document-preview {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    border: 2px solid #ddd;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px;
    text-align: center;
}

.document-icon {
    font-size: 2em;
    margin-bottom: 5px;
}

.audio-preview {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    border: 2px solid #ddd;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px;
    text-align: center;
}

.audio-icon {
    font-size: 2em;
    margin-bottom: 5px;
}

.document-name {
    font-size: 0.7em;
    color: #333;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.document-type {
    font-size: 0.65em;
    color: #666;
    background: #e0e0e0;
    padding: 2px 6px;
    border-radius: 3px;
    margin-top: 3px;
}

.summary-document-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ddd;
    min-width: 80px;
}

.summary-document-item .document-icon {
    font-size: 1.5em;
}

.summary-document-item .document-name {
    font-size: 0.7em;
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* VCF Editor Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s;
    position: relative;
}

.editor-modal {
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.small-modal {
    width: 90%;
    max-width: 500px;
    padding: 30px;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 2px solid #e0e0e0;
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    color: white;
    border-radius: 15px 15px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5em;
}

.close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.editor-tools {
    padding: 20px 30px;
    background: #f5f5f5;
    border-bottom: 2px solid #e0e0e0;
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.editor-tools .search-box {
    flex: 1;
    min-width: 200px;
    margin: 0;
}

.editor-stats {
    padding: 8px 15px;
    background: white;
    border-radius: 8px;
    border: 2px solid #ddd;
    font-weight: bold;
    color: #25d366;
}

.editor-contact-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px 30px;
    max-height: 500px;
}

.editor-contact-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    margin-bottom: 10px;
    background: white;
    transition: all 0.3s;
}

.editor-contact-item:hover {
    border-color: #25d366;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.2);
    transform: translateX(5px);
}

.editor-contact-info {
    flex: 1;
}

.editor-contact-name {
    font-weight: bold;
    font-size: 1.1em;
    color: #333;
    margin-bottom: 5px;
}

.editor-contact-phone {
    color: #666;
    font-size: 0.9em;
}

.editor-contact-actions {
    display: flex;
    gap: 10px;
}

.editor-action-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s;
    font-weight: bold;
}

.editor-edit-btn {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    color: white;
}

.editor-edit-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
}

.editor-delete-btn {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: white;
}

.editor-delete-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.4);
}

.modal-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    justify-content: flex-end;
}

.small-modal h3 {
    margin-bottom: 20px;
    color: #128c7e;
    font-size: 1.3em;
}

.small-modal .input-group {
    margin: 15px 0;
}

.small-modal .input-group label {
    color: #333;
    font-weight: bold;
    margin-bottom: 8px;
}

.small-modal .input-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.small-modal .input-group input:focus {
    outline: none;
    border-color: #25d366;
}

/* Responsive */
@media (max-width: 768px) {
    .editor-modal {
        width: 95%;
        max-height: 95vh;
    }

    .small-modal {
        width: 95%;
        padding: 20px;
    }

    .editor-tools {
        flex-direction: column;
        align-items: stretch;
    }

    .editor-tools .search-box {
        width: 100%;
    }

    .editor-contact-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .editor-contact-actions {
        width: 100%;
        justify-content: flex-end;
    }
}