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

/* Login Screen */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-box {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #333;
}

.input-group {
    margin-bottom: 1rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    font-weight: 500;
}

.input-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

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

.login-box button {
    width: 100%;
    padding: 0.75rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.login-box button:hover {
    background: #5a6fd8;
}

/* Admin Panel */
.admin-container {
    min-height: 100vh;
    background: #f5f5f5;
}

.header {
    background: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    color: #333;
    font-size: 1.5rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-disconnected {
    color: #e74c3c;
    font-weight: 500;
}

.status-connected {
    color: #27ae60;
    font-weight: 500;
}

.logout-btn {
    padding: 0.5rem 1rem;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: #c0392b;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.left-panel, .right-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.section {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.section h3 {
    margin-bottom: 1rem;
    color: #333;
    font-size: 1.2rem;
}

.help-text {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    resize: vertical;
    transition: border-color 0.3s;
}

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

.phone-count, .char-count {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #666;
    text-align: right;
}

.button-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: #27ae60;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #229954;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

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

.btn-danger:hover:not(:disabled) {
    background: #c0392b;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover:not(:disabled) {
    background: #e67e22;
}

/* QR Code Section */
#qrContainer {
    text-align: center;
    padding: 1rem;
}

.qr-placeholder {
    padding: 2rem;
    border: 2px dashed #ddd;
    border-radius: 5px;
    color: #666;
}

#qrCode {
    max-width: 100%;
    height: auto;
}

/* Log Section */
.log-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.log-container {
    background: #1a1a1a;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    height: 300px;
    overflow-y: auto;
    padding: 1rem;
    border-radius: 5px;
    border: 1px solid #333;
}

.log-entry {
    margin-bottom: 0.25rem;
    display: flex;
    gap: 0.5rem;
}

.log-entry.error {
    color: #ff6b6b;
}

.log-entry.success {
    color: #51cf66;
}

.log-entry.warning {
    color: #ffd43b;
}

.log-entry.system {
    color: #74c0fc;
}

.timestamp {
    color: #666;
    min-width: 80px;
}

/* Progress Section */
.progress-section {
    background: white;
    margin: 0 2rem 2rem;
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #ecf0f1;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #27ae60, #2ecc71);
    width: 0%;
    transition: width 0.3s ease;
}

/* Time Interval Section */
.time-interval-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.time-interval-inputs .input-group {
    margin-bottom: 0;
}

.time-interval-inputs input {
    width: 100%;
    padding: 0.5rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 0.9rem;
    transition: border-color 0.3s;
}

.time-interval-inputs input:focus {
    outline: none;
    border-color: #667eea;
}

.interval-info {
    font-size: 0.8rem;
    color: #666;
    text-align: center;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 5px;
    border: 1px solid #e9ecef;
}

/* Phone controls */
.phone-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.phone-count {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #666;
    text-align: right;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.failed-count {
    color: #e74c3c;
    font-weight: 500;
}

.success-count {
    color: #27ae60;
    font-weight: 500;
}

/* Connection controls */
.connection-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    justify-content: center;
}

/* Status indicator updates */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    
    .header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .btn {
        justify-content: center;
    }
    
    .time-interval-inputs {
        grid-template-columns: 1fr;
    }
    
    .status-indicator {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .phone-controls {
        flex-direction: column;
    }
    
    .phone-count {
        flex-direction: column;
        text-align: left;
        gap: 0.25rem;
    }
}

/* Scrollbar Styling */
.log-container::-webkit-scrollbar {
    width: 8px;
}

.log-container::-webkit-scrollbar-track {
    background: #2a2a2a;
}

.log-container::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

.log-container::-webkit-scrollbar-thumb:hover {
    background: #777;
}

/* New button styles */
.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #229954;
}

/* Image Upload Styles */
.image-upload-area {
    margin-top: 1rem;
}

.image-drop-zone {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    background: #fafafa;
    transition: all 0.3s ease;
    cursor: pointer;
}

.image-drop-zone:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.image-drop-zone.drag-over {
    border-color: #667eea;
    background: #e8f2ff;
    transform: scale(1.02);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.drop-icon {
    font-size: 3rem;
    opacity: 0.6;
}

.drop-zone-content p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.image-preview {
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    background: white;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.image-preview img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.image-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.image-info span {
    font-size: 0.8rem;
    color: #666;
}

.image-info span:first-child {
    font-weight: 500;
    color: #333;
}

/* Responsive adjustments for image upload */
@media (max-width: 768px) {
    .image-preview {
        flex-direction: column;
        text-align: center;
    }
    
    .image-info {
        align-items: center;
    }
}

/* Excel Upload Styles */
.excel-upload-section {
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.excel-upload-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover:not(:disabled) {
    background: #138496;
}

.excel-preview {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 1rem;
}

.excel-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.excel-info span:first-child {
    font-weight: 500;
    color: #333;
}

.excel-info span:nth-child(2) {
    color: #666;
    font-size: 0.9rem;
}

.excel-data-preview {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 4px;
}

.excel-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.excel-table th,
.excel-table td {
    padding: 0.5rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.excel-table th {
    background: #f8f9fa;
    font-weight: 500;
    position: sticky;
    top: 0;
}

.excel-table tr:hover {
    background: #f8f9fa;
}

/* Responsive adjustments for excel upload */
@media (max-width: 768px) {
    .excel-upload-controls {
        flex-direction: column;
    }
    
    .excel-info {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .excel-table {
        font-size: 0.7rem;
    }
    
    .excel-table th,
    .excel-table td {
        padding: 0.25rem;
    }
}
