/**
 * Cold Emails Generator - Scoped CSS Styles
 * All classes prefixed with "cemail-" to prevent conflicts
 */

/* Container and Layout */
.cemail-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
}

.cemail-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 0;
}

.cemail-title {
    font-size: 2.5em;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 10px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cemail-subtitle {
    font-size: 1.2em;
    color: #7f8c8d;
    margin: 0;
    font-weight: 300;
}

.cemail-main-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

/* Card Styles */
.cemail-card {
    background: #fff;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.cemail-card:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.cemail-input-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.cemail-output-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    min-height: 600px;
}

.cemail-card-title {
    font-size: 1.5em;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 25px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

/* Form Styles */
.cemail-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cemail-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cemail-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.cemail-label {
    font-weight: 600;
    color: #495057;
    font-size: 0.95em;
    margin-bottom: 5px;
}

.cemail-input,
.cemail-textarea,
.cemail-select {
    padding: 14px 16px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1em;
    transition: all 0.3s ease;
    background: #fff;
    font-family: inherit;
}

.cemail-input:focus,
.cemail-textarea:focus,
.cemail-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.cemail-textarea {
    resize: vertical;
    min-height: 80px;
}

.cemail-help-text {
    font-size: 0.85em;
    color: #6c757d;
    margin-top: 4px;
}

/* Button Styles */
.cemail-btn {
    padding: 14px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.cemail-btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.cemail-btn:hover:before {
    left: 100%;
}

.cemail-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.cemail-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.cemail-btn-secondary {
    background: #6c757d;
    color: white;
}

.cemail-btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.cemail-btn-outline {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.cemail-btn-outline:hover {
    background: #667eea;
    color: white;
    transform: translateY(-1px);
}

.cemail-btn-small {
    padding: 8px 16px;
    font-size: 0.9em;
}

.cemail-btn-success {
    background: #28a745 !important;
    color: white !important;
    border-color: #28a745 !important;
}

.cemail-btn.cemail-loading {
    opacity: 0.7;
    cursor: not-allowed;
}

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

/* Output Styles */
.cemail-output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

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

.cemail-output-container {
    min-height: 400px;
}

.cemail-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 400px;
    color: #6c757d;
    text-align: center;
}

.cemail-placeholder-icon {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.5;
}

.cemail-placeholder p {
    font-size: 1.1em;
    max-width: 300px;
    line-height: 1.6;
}

/* Email Item Styles */
.cemail-email-item {
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.cemail-email-item:hover {
    border-color: #667eea;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.1);
}

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

.cemail-email-title {
    font-size: 1.2em;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.cemail-email-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cemail-subject-line,
.cemail-email-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cemail-subject-line strong,
.cemail-email-body strong {
    color: #495057;
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cemail-subject-text,
.cemail-body-text {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    min-height: 20px;
}

.cemail-subject-text:focus,
.cemail-body-text:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.cemail-body-text {
    min-height: 120px;
    line-height: 1.7;
}

/* Loading Animation */
@keyframes cemail-pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

.cemail-btn-loader {
    animation: cemail-pulse 1.5s ease-in-out infinite;
}

/* Responsive Design */
@media (max-width: 992px) {
    .cemail-main-wrapper {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .cemail-output-card {
        min-height: auto;
    }
}

@media (max-width: 768px) {
    .cemail-container {
        padding: 15px;
    }
    
    .cemail-title {
        font-size: 2em;
    }
    
    .cemail-card {
        padding: 20px;
    }
    
    .cemail-form-row {
        grid-template-columns: 1fr;
    }
    
    .cemail-form-actions {
        flex-direction: column;
    }
    
    .cemail-btn {
        width: 100%;
    }
    
    .cemail-output-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .cemail-output-actions {
        justify-content: center;
    }
    
    .cemail-email-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .cemail-placeholder {
        height: 300px;
    }
    
    .cemail-placeholder-icon {
        font-size: 3em;
    }
}

@media (max-width: 480px) {
    .cemail-container {
        padding: 10px;
    }
    
    .cemail-title {
        font-size: 1.8em;
    }
    
    .cemail-subtitle {
        font-size: 1em;
    }
    
    .cemail-card {
        padding: 15px;
    }
    
    .cemail-input,
    .cemail-textarea,
    .cemail-select {
        padding: 12px 14px;
    }
    
    .cemail-btn {
        padding: 12px 20px;
    }
    
    .cemail-btn-small {
        padding: 8px 14px;
        font-size: 0.85em;
    }
    
    .cemail-output-actions {
        flex-direction: column;
    }
    
    .cemail-email-item {
        padding: 15px;
    }
}

/* Accessibility Enhancements */
.cemail-btn:focus,
.cemail-input:focus,
.cemail-textarea:focus,
.cemail-select:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .cemail-btn,
    .cemail-card,
    .cemail-input,
    .cemail-textarea,
    .cemail-select,
    .cemail-email-item,
    .cemail-subject-text,
    .cemail-body-text {
        transition: none;
    }
    
    .cemail-btn-loader {
        animation: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .cemail-card {
        border: 2px solid #000;
    }
    
    .cemail-btn-primary {
        background: #000;
        border: 2px solid #000;
    }
    
    .cemail-btn-outline {
        border: 2px solid #000;
        color: #000;
    }
    
    .cemail-input,
    .cemail-textarea,
    .cemail-select {
        border: 2px solid #000;
    }
}

/* Print Styles */
@media print {
    .cemail-container {
        max-width: none;
        padding: 0;
    }
    
    .cemail-main-wrapper {
        grid-template-columns: 1fr;
    }
    
    .cemail-input-card {
        display: none;
    }
    
    .cemail-card {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .cemail-btn {
        display: none;
    }
    
    .cemail-email-item {
        break-inside: avoid;
        margin-bottom: 30px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .cemail-container {
        color: #e9ecef;
    }
    
    .cemail-card {
        background: #2c3e50;
        border-color: #495057;
    }
    
    .cemail-input-card {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    }
    
    .cemail-output-card {
        background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    }
    
    .cemail-title,
    .cemail-card-title,
    .cemail-email-title {
        color: #fff;
    }
    
    .cemail-subtitle {
        color: #adb5bd;
    }
    
    .cemail-input,
    .cemail-textarea,
    .cemail-select {
        background: #495057;
        border-color: #6c757d;
        color: #fff;
    }
    
    .cemail-subject-text,
    .cemail-body-text {
        background: #495057;
        border-color: #6c757d;
        color: #fff;
    }
    
    .cemail-email-item {
        background: #495057;
        border-color: #6c757d;
    }
    
    .cemail-placeholder {
        color: #adb5bd;
    }
}