* {
    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;
}

header {
    background: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

header h1 {
    color: #333;
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    color: #666;
    font-size: 1.1em;
}

.card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

/* Upload Section */
.upload-section {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.file-input {
    flex: 1;
    min-width: 200px;
    padding: 10px;
    border: 2px dashed #667eea;
    border-radius: 5px;
    cursor: pointer;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

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

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

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

.btn-danger:hover {
    background: #c82333;
}

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

.btn-large {
    padding: 16px 32px;
    font-size: 1.2em;
    width: 100%;
}

.btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* List Section */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
}

#phoneCount {
    font-weight: 600;
    color: #667eea;
}

.phone-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
}

.phone-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s ease;
}

.phone-item:hover {
    background: #f8f9fa;
}

.phone-item:last-child {
    border-bottom: none;
}

.phone-number {
    font-family: 'Courier New', monospace;
    font-size: 1.1em;
    color: #333;
}

.remove-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
}

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

/* Message Section */
.message-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#messageInput {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 1em;
    font-family: inherit;
    resize: vertical;
}

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

.message-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#charCount {
    color: #666;
    font-weight: 600;
}

.preview-section {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    border-left: 4px solid #667eea;
}

.preview-section h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1em;
}

.preview-text {
    background: white;
    padding: 15px;
    border-radius: 5px;
    font-family: inherit;
    color: #333;
    line-height: 1.6;
    min-height: 50px;
}

/* Status Messages */
.status-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 5px;
    display: none;
}

.status-message.show {
    display: block;
}

.status-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Results Section */
.results-section {
    margin-top: 20px;
    display: none;
}

.results-section.show {
    display: block;
}

.results-summary {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 15px;
}

.results-summary h3 {
    margin-bottom: 10px;
    color: #333;
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.stat-item {
    padding: 15px;
    border-radius: 5px;
    text-align: center;
}

.stat-item.total {
    background: #d1ecf1;
    color: #0c5460;
}

.stat-item.success {
    background: #d4edda;
    color: #155724;
}

.stat-item.failed {
    background: #f8d7da;
    color: #721c24;
}

.stat-value {
    font-size: 2em;
    font-weight: bold;
    display: block;
}

.stat-label {
    font-size: 0.9em;
    margin-top: 5px;
}

.results-details {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
}

.result-item {
    padding: 10px 15px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-item:last-child {
    border-bottom: none;
}

.result-item.success {
    background: #f0fdf4;
}

.result-item.error {
    background: #fef2f2;
}

.result-phone {
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

.result-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 600;
}

.result-status.success {
    background: #28a745;
    color: white;
}

.result-status.error {
    background: #dc3545;
    color: white;
}

/* Help Text */
.help-text {
    color: #666;
    font-size: 0.9em;
    margin-top: 8px;
}

/* Loading Spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Logs Section */
.logs-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.logs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    flex: 1;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stat-card .stat-value {
    display: block;
    font-size: 1.8em;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-card .stat-label {
    display: block;
    font-size: 0.85em;
    opacity: 0.9;
}

.logs-container {
    max-height: 600px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    background: #fafafa;
}

.log-entry {
    background: white;
    margin: 10px;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.log-date {
    font-weight: 600;
    color: #333;
    font-size: 0.95em;
}

.log-id {
    font-size: 0.8em;
    color: #999;
    font-family: 'Courier New', monospace;
}

.log-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.log-message {
    color: #333;
}

.log-message strong {
    color: #667eea;
}

.log-text {
    display: block;
    margin-top: 5px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    font-style: italic;
}

.log-stats {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.log-stat {
    padding: 6px 12px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: 600;
}

.log-stat.success {
    background: #d4edda;
    color: #155724;
}

.log-stat.failed {
    background: #f8d7da;
    color: #721c24;
}

.log-stat.rate {
    background: #d1ecf1;
    color: #0c5460;
}

.log-details {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
    border: 1px solid #e0e0e0;
}

.log-details h4 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1em;
}

.details-list {
    max-height: 200px;
    overflow-y: auto;
}

.detail-item {
    display: grid;
    grid-template-columns: 2fr 1fr 3fr;
    gap: 10px;
    padding: 8px 10px;
    margin-bottom: 5px;
    background: white;
    border-radius: 4px;
    align-items: center;
}

.detail-item.success {
    border-left: 3px solid #28a745;
}

.detail-item.error {
    border-left: 3px solid #dc3545;
}

.detail-phone {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #333;
}

.detail-status {
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    text-align: center;
}

.detail-status.success {
    background: #28a745;
    color: white;
}

.detail-status.error {
    background: #dc3545;
    color: white;
}

.detail-message {
    font-size: 0.85em;
    color: #666;
}

.loading-message, .empty-logs, .error-logs {
    padding: 40px;
    text-align: center;
    color: #666;
    font-size: 1.1em;
}

.empty-logs {
    color: #999;
}

.error-logs {
    color: #dc3545;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header h1 {
        font-size: 1.8em;
    }

    .card {
        padding: 15px;
    }

    .upload-section {
        flex-direction: column;
    }

    .file-input {
        width: 100%;
    }

    .logs-header {
        flex-direction: column;
    }

    .stats-container {
        width: 100%;
    }

    .detail-item {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .log-stats {
        flex-direction: column;
        gap: 8px;
    }
}

