/* UTM Builder Specific Styles */

/* Mode Selection */
.mode-selection {
    padding: 2rem 3rem 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.mode-tabs {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.mode-tab {
    padding: 0.75rem 2rem;
    border: 2px solid #e2e8f0;
    background: white;
    color: #64748b;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 1rem;
}

.mode-tab.active {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

.mode-tab:hover:not(.active) {
    border-color: #667eea;
    color: #667eea;
}

/* Single URL Section */
.single-url-section {
    padding: 3rem;
}

.url-input-container {
    margin-bottom: 2rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-weight: 600;
    color: #374151;
}

#baseUrl {
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

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

#baseUrl:invalid {
    border-color: #ef4444;
}

/* UTM Parameters */
.utm-parameters {
    margin-bottom: 2rem;
    padding: 2rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.utm-parameters h3 {
    margin: 0 0 1.5rem 0;
    color: #1e293b;
    font-size: 1.4rem;
    text-align: center;
}

.parameters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.parameter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.parameter-group label {
    font-weight: 600;
    color: #374151;
    font-size: 0.95rem;
}

.parameter-group input {
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border-color 0.2s ease;
}

.parameter-group input:focus {
    outline: none;
    border-color: #667eea;
}

.parameter-group small {
    color: #64748b;
    font-size: 0.8rem;
    line-height: 1.4;
}

/* Required field styling */
.parameter-group label[for="utmSource"]::after,
.parameter-group label[for="utmMedium"]::after,
.parameter-group label[for="utmCampaign"]::after,
.parameter-group label[for="batchUtmSource"]::after,
.parameter-group label[for="batchUtmMedium"]::after,
.parameter-group label[for="batchUtmCampaign"]::after {
    content: " *";
    color: #ef4444;
}

/* Live Preview Section */
.preview-section {
    background: white;
    border: 2px solid #10b981;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.preview-section h3 {
    margin: 0 0 1rem 0;
    color: #1e293b;
    font-size: 1.3rem;
    text-align: center;
}

.preview-container {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.preview-url {
    flex: 1;
    padding: 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    word-break: break-all;
    min-height: 3rem;
    display: flex;
    align-items: center;
}

.preview-url.has-content {
    color: #059669;
    background: #ecfdf5;
    border-color: #10b981;
}

.placeholder-text {
    color: #9ca3af;
    font-style: italic;
}

.url-actions {
    text-align: center;
    margin-top: 1rem;
}

.btn-outline {
    background: transparent;
    border: 2px solid #e2e8f0;
    color: #64748b;
}

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

/* Batch CSV Section */
.batch-csv-section {
    padding: 3rem;
}

.csv-upload-container {
    margin-bottom: 2rem;
}

.upload-info {
    margin-bottom: 2rem;
    text-align: center;
}

.upload-info h3 {
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.upload-info p {
    color: #64748b;
    margin-bottom: 1rem;
}

.csv-example {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem auto;
    max-width: 400px;
    text-align: left;
}

.csv-example strong {
    display: block;
    margin-bottom: 0.5rem;
    color: #374151;
}

.csv-example code {
    display: block;
    background: white;
    padding: 0.75rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.875rem;
    color: #059669;
    border: 1px solid #d1fae5;
    line-height: 1.4;
}

.csv-upload-area {
    border: 3px dashed #e2e8f0;
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    background: #f8fafc;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 1rem;
}

.csv-upload-area:hover,
.csv-upload-area.dragover {
    border-color: #667eea;
    background: #f1f5f9;
}

.csv-upload-area .upload-content svg {
    color: #94a3b8;
    margin-bottom: 1rem;
}

.csv-upload-area h4 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #1e293b;
}

.csv-upload-area p {
    color: #64748b;
    margin: 0;
}

/* Loaded URLs Display */
.loaded-urls {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
    margin-bottom: 2rem;
}

.loaded-urls h4 {
    margin-bottom: 1rem;
    color: #1e293b;
    font-size: 1.2rem;
}

.urls-list {
    display: grid;
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
}

.url-item {
    background: white;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.85rem;
    word-break: break-all;
    color: #374151;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.url-item .url-index {
    background: #667eea;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 30px;
    text-align: center;
}

/* Batch UTM Parameters */
.batch-utm-parameters {
    background: #f8fafc;
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid #e2e8f0;
    margin-bottom: 2rem;
}

.batch-utm-parameters h3 {
    margin: 0 0 1.5rem 0;
    color: #1e293b;
    font-size: 1.4rem;
    text-align: center;
}

.batch-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* Batch Results */
.batch-results {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    margin-top: 2rem;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.results-header h3 {
    margin: 0;
    color: #1e293b;
    font-size: 1.3rem;
}

.results-table-container {
    overflow-x: auto;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
}

.results-table th {
    background: #667eea;
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.results-table td {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

.results-table tr:last-child td {
    border-bottom: none;
}

.results-table tr:nth-child(even) {
    background: #f8fafc;
}

.url-cell {
    max-width: 300px;
    word-break: break-all;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.85rem;
    color: #64748b;
}

.utm-url-cell {
    max-width: 400px;
    word-break: break-all;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.85rem;
    color: #059669;
    font-weight: 500;
}

.copy-cell {
    text-align: center;
    width: 100px;
}

.copy-btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    border: none;
    border-radius: 4px;
    background: #667eea;
    color: white;
    cursor: pointer;
    transition: background 0.2s ease;
    white-space: nowrap;
}

.copy-btn-small:hover {
    background: #5a67d8;
}

.copy-btn-small.copied {
    background: #10b981;
}

.copy-btn-small.copied::after {
    content: ' ✓';
}

/* Copy success animation */
.copy-success {
    background: #10b981 !important;
    color: white !important;
}

.copy-success::after {
    content: ' ✓';
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .mode-tabs {
        flex-direction: column;
        align-items: center;
    }
    
    .mode-tab {
        width: 200px;
        text-align: center;
    }
    
    .single-url-section,
    .batch-csv-section {
        padding: 2rem 1.5rem;
    }
    
    .mode-selection {
        padding: 2rem 1.5rem 1rem;
    }
    
    .parameters-grid {
        grid-template-columns: 1fr;
    }
    
    .preview-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .batch-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .results-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .results-table-container {
        overflow-x: auto;
    }
    
    .results-table {
        min-width: 600px;
    }
    
    .url-actions {
        margin-top: 1rem;
    }
}