/**
 * SMS Conversation Viewer - Styles
 * Professional design with iPhone mockup and message bubbles
 */

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

header .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Main content */
main {
    display: grid;
    gap: 30px;
    grid-template-columns: 1fr;
}

/* Form card */
.form-card {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* Form styles */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #444;
    font-size: 0.95rem;
}

.form-group select,
.form-group input[type="tel"],
.form-group input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background-color: white;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group select {
    cursor: pointer;
}

.form-group select[size] {
    height: auto;
    min-height: 200px;
    margin-top: 8px;
    padding: 8px;
}

.form-group select[size] option {
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 4px;
    margin-bottom: 2px;
}

.form-group select[size] option:hover {
    background-color: #f0f0f0;
}

.form-group select[size] option:checked {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

#company-filter {
    margin-bottom: 0;
}

.form-group select:hover,
.form-group input[type="tel"]:hover,
.form-group input[type="text"]:hover {
    border-color: #667eea;
}

.form-group select:focus,
.form-group input[type="tel"]:focus,
.form-group input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-help {
    display: block;
    margin-top: 6px;
    font-size: 0.85rem;
    color: #888;
}

/* Button styles */
.btn-primary {
    width: 100%;
    padding: 14px 24px;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-icon {
    font-size: 1.3rem;
    transition: transform 0.3s;
}

.btn-primary:hover:not(:disabled) .btn-icon {
    transform: translateX(4px);
}

/* Loading indicator */
.loading {
    text-align: center;
    padding: 30px 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-top: 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    border: 4px solid #e0e0e0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading p {
    color: #666;
    font-size: 0.95rem;
}

/* Error message */
.error-message {
    padding: 16px 20px;
    border-radius: 8px;
    margin-top: 20px;
    background-color: #fee;
    border-left: 4px solid #c00;
    color: #c00;
    font-size: 0.95rem;
}

/* Mobile Phone Preview */
.phone-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
}

.phone-frame {
    width: 60%;
    max-width: 800px;
    min-width: 400px;
    height: 934px;
    background: #1a1a1a;
    border-radius: 40px;
    padding: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
}

.phone-notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 25px;
    background: #1a1a1a;
    border-radius: 0 0 15px 15px;
    z-index: 10;
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: #f5f5f5;
    border-radius: 28px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.conversation-header {
    background: white;
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    text-align: center;
    z-index: 5;
}

.conversation-header h3 {
    font-size: 1rem;
    color: #333;
    margin-bottom: 4px;
}

.message-count {
    font-size: 0.85rem;
    color: #888;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 15px 10px;
    background: #f5f5f5;
    scroll-behavior: smooth;
}

/* Custom scrollbar for messages */
.messages-container::-webkit-scrollbar {
    width: 6px;
}

.messages-container::-webkit-scrollbar-track {
    background: transparent;
}

.messages-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

/* Date headers */
.date-header {
    text-align: center;
    color: #888;
    font-size: 0.75rem;
    margin: 20px 0 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Message bubbles */
.message-bubble {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
    animation: fadeIn 0.3s ease-in;
    max-width: 90%;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Outbound messages - Client sent (right, blue) */
.message-bubble.outbound {
    align-self: flex-end;
    align-items: flex-end;
}

.message-bubble.outbound .bubble-content {
    background: #007aff;
    color: white;
    border-bottom-right-radius: 4px;
}

/* Inbound messages - Candidate sent (left, gray) */
.message-bubble.inbound {
    align-self: flex-start;
    align-items: flex-start;
}

.message-bubble.inbound .bubble-content {
    background: #e5e5ea;
    color: #000;
    border-bottom-left-radius: 4px;
}

.bubble-content {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 18px;
    word-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
    line-height: 1.4;
}

.message-timestamp {
    font-size: 0.7rem;
    color: #888;
    margin-top: 4px;
    padding: 0 4px;
}

/* Footer */
footer {
    text-align: center;
    color: white;
    margin-top: 40px;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Responsive design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .form-card {
        padding: 25px;
    }

    .phone-frame {
        width: 80%;
        height: 800px;
        border-radius: 35px;
        padding: 12px;
    }

    .phone-screen {
        border-radius: 24px;
    }

    .phone-notch {
        width: 120px;
        height: 20px;
    }
}

@media (max-width: 500px) {
    .phone-frame {
        width: 95%;
        min-width: 280px;
        height: 700px;
    }
}
