/* SIM Card Usage Checker - Modern CSS Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #ffffff;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

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

.header {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 20px;
}

.header h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.header p {
    color: #7f8c8d;
    font-size: 1.1rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
}

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

.form-control.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.form-control.success {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

.form-validation {
    margin-top: 5px;
    font-size: 0.875rem;
}

.form-validation.error {
    color: #dc3545;
}

.form-validation.success {
    color: #28a745;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

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

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

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

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
}

/* Scanner Styles */
.scanner-container {
    margin: 20px 0;
    text-align: center;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    border: 2px dashed #667eea;
}

.scanner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.scanner-header h4 {
    margin: 0;
    color: #2c3e50;
}

.scanner-preview {
    position: relative;
    max-width: 100%;
    width: 100%;
    height: 300px;
    border-radius: 8px;
    margin: 10px 0;
    background: #000;
    overflow: hidden;
}

.scanner-preview canvas,
.scanner-preview video {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    border-radius: 8px;
}

.scanner-preview canvas.drawingBuffer {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
}

.scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    z-index: 10;
}

.scanner-frame {
    width: 80%;
    max-width: 300px;
    height: 120px;
    border: 3px solid #667eea;
    border-radius: 8px;
    background: transparent;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.4);
    position: relative;
}

.scanner-frame::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    animation: scannerPulse 2s infinite;
}

@keyframes scannerPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.scanner-instructions {
    margin-top: 15px;
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.4;
}

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

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.875rem;
}

/* Recent Searches */
.recent-searches {
    margin-top: 30px;
}

.recent-searches h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.search-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.search-item .iccid {
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

.search-item .timestamp {
    color: #6c757d;
    font-size: 0.9rem;
}

/* SIM Info Display */
.sim-info {
    margin: 20px 0;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.info-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.info-card h4 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.info-card .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
}

.info-card .unit {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Usage Gauge Styles */
.usage-gauge {
    margin-top: 15px;
}

.usage-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    text-align: center;
}

.progress-bar-container {
    width: 100%;
    height: 20px;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    margin-bottom: 5px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #28a745 0%, #20c997 50%, #ffc107 80%, #dc3545 100%);
    border-radius: 10px;
    transition: width 0.8s ease-in-out;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        rgba(255,255,255,0.2) 25%, 
        transparent 25%, 
        transparent 50%, 
        rgba(255,255,255,0.2) 50%, 
        rgba(255,255,255,0.2) 75%, 
        transparent 75%);
    background-size: 20px 20px;
    animation: progressStripes 1s linear infinite;
}

@keyframes progressStripes {
    0% { background-position: 0 0; }
    100% { background-position: 20px 0; }
}

.usage-percentage {
    font-size: 0.9rem;
    color: #6c757d;
    text-align: center;
    margin-top: 5px;
}

/* Loading Indicator */
.loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error Messages */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 10px 0;
    border: 1px solid #f5c6cb;
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 10px 0;
    border: 1px solid #c3e6cb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .card {
        padding: 20px;
        margin: 10px 0;
    }
    
    .logo {
        max-width: 150px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .btn {
        width: 100%;
        margin: 5px 0;
    }
    
    .scanner-preview {
        height: 250px;
    }
    
    .scanner-frame {
        width: 90%;
        height: 100px;
    }
    
    .scanner-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .scanner-header h4 {
        text-align: center;
    }
    
    .usage-text {
        font-size: 1rem;
    }
    
    .progress-bar-container {
        height: 16px;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

.flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}