/* Tool Page Common Styles */
.tool-page {
    padding-top: 0;
}

.breadcrumb {
    padding: 20px 0;
    font-size: 14px;
    color: #666;
}

.breadcrumb a {
    color: #666;
    transition: all 0.3s;
}

.breadcrumb a:hover {
    color: #FF5722;
}

.breadcrumb .separator {
    margin: 0 10px;
    color: #ddd;
}

.breadcrumb .current {
    color: #333;
    font-weight: 600;
}

.tool-header {
    background: linear-gradient(135deg, #FF5722 0%, #E64A19 100%);
    color: white;
    padding: 60px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.tool-header::before {
    content: '|||||||||||';
    position: absolute;
    font-size: 200px;
    opacity: 0.05;
    top: -30px;
    left: -30px;
    font-family: monospace;
    letter-spacing: 20px;
    animation: scan 3s linear infinite;
}

@keyframes scan {
    0% { transform: translateY(0); }
    100% { transform: translateY(50px); }
}

.tool-header-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.tool-icon-large {
    font-size: 72px;
    margin-bottom: 20px;
    animation: zoom 2s ease-in-out infinite;
}

@keyframes zoom {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.tool-header h1 {
    font-size: 48px;
    font-weight: 900;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.tool-subtitle {
    font-size: 20px;
    opacity: 0.95;
    margin-bottom: 25px;
    line-height: 1.6;
}

.tool-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    font-size: 16px;
}

.meta-separator {
    opacity: 0.5;
}

.tool-content {
    padding: 60px 20px;
    background: #f8f9fa;
}

/* Barcode Scanner Container */
.barcode-scanner-container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 25px;
    box-shadow: 0 15px 60px rgba(0,0,0,0.12);
    overflow: hidden;
}

.barcode-scanner-header {
    background: linear-gradient(135deg, #FF5722 0%, #E64A19 100%);
    padding: 45px 30px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.barcode-scanner-header::before {
    content: '||||||||||||||||';
    position: absolute;
    font-size: 120px;
    opacity: 0.1;
    top: -20px;
    right: -20px;
    font-family: monospace;
    letter-spacing: 5px;
    transform: rotate(-15deg);
}

.barcode-scanner-header h2 {
    font-size: 38px;
    margin-bottom: 10px;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.barcode-scanner-header p {
    font-size: 16px;
    opacity: 0.95;
    margin: 0;
    position: relative;
    z-index: 1;
}

.barcode-scanner-body {
    padding: 40px 30px;
}

/* Scan Tabs */
.barcode-scan-tabs {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    border-bottom: 3px solid #f0f0f0;
}

.barcode-scan-tab {
    flex: 1;
    padding: 18px 25px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    margin-bottom: -3px;
}

.barcode-scan-tab:hover {
    color: #FF5722;
    background: #FBE9E7;
}

.barcode-scan-tab.active {
    color: #FF5722;
    border-bottom-color: #FF5722;
    background: #FBE9E7;
}

/* Format Selection */
.barcode-format-selection {
    background: linear-gradient(135deg, #FBE9E7 0%, #FFCCBC 100%);
    padding: 20px 25px;
    border-radius: 15px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.barcode-format-selection label {
    font-weight: 700;
    color: #E64A19;
    font-size: 15px;
}

.barcode-format-selection select {
    flex: 1;
    min-width: 200px;
    padding: 12px 18px;
    border: 3px solid rgba(255, 87, 34, 0.3);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.barcode-format-selection select:focus {
    outline: none;
    border-color: #FF5722;
    box-shadow: 0 0 0 4px rgba(255, 87, 34, 0.1);
}

/* Camera Section */
.barcode-scan-section {
    background: white;
    padding: 0;
}

.barcode-camera-box {
    position: relative;
    background: #000;
    border-radius: 20px;
    overflow: hidden;
    max-width: 600px;
    margin: 0 auto 25px;
    aspect-ratio: 4/3;
}

#barcodeCameraView {
    width: 100%;
    height: 100%;
}

#barcodeCameraView video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#barcodeCameraView canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.barcode-scan-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
}

.barcode-scan-line {
    width: 80%;
    height: 150px;
    border: 4px solid #FF5722;
    border-left: none;
    border-right: none;
    position: relative;
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.5);
    animation: scan-line 2s ease-in-out infinite;
}

@keyframes scan-line {
    0%, 100% { 
        border-color: #FF5722;
        box-shadow: 0 0 0 9999px rgba(0,0,0,0.5), 0 0 20px rgba(255, 87, 34, 0.5);
    }
    50% { 
        border-color: #FFCCBC;
        box-shadow: 0 0 0 9999px rgba(0,0,0,0.5), 0 0 40px rgba(255, 87, 34, 0.8);
    }
}

.barcode-scan-line::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -20px;
    right: -20px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #FF5722, transparent);
    animation: laser 2s linear infinite;
}

@keyframes laser {
    0% { transform: translateY(-75px); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateY(75px); opacity: 0; }
}

.barcode-camera-status {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    max-width: 90%;
    text-align: center;
}

.barcode-camera-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Upload Section */
.barcode-upload-box {
    border: 3px dashed #FF5722;
    border-radius: 20px;
    padding: 60px 40px;
    background: linear-gradient(135deg, #FBE9E7 0%, #FFCCBC 100%);
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    margin-bottom: 25px;
}

.barcode-upload-box:hover {
    background: linear-gradient(135deg, #FFCCBC 0%, #FFAB91 100%);
    border-color: #E64A19;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 87, 34, 0.2);
}

.barcode-upload-icon {
    font-size: 72px;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.barcode-upload-text {
    font-size: 20px;
    color: #FF5722;
    font-weight: 700;
    margin-bottom: 10px;
}

.upload-hint {
    color: #666;
    font-size: 14px;
    margin: 10px 0 0 0;
}

.barcode-uploaded-preview {
    text-align: center;
}

.barcode-uploaded-preview h4 {
    font-size: 18px;
    font-weight: 700;
    color: #FF5722;
    margin-bottom: 15px;
}

.barcode-uploaded-preview img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.barcode-processing {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.processing-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #FF5722;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.barcode-processing p {
    color: #666;
    font-weight: 600;
}

/* Result Section */
.barcode-result-section {
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    padding: 35px;
    border-radius: 20px;
    margin-bottom: 30px;
}

.barcode-result-section h3 {
    color: #2E7D32;
    font-size: 26px;
    margin-bottom: 20px;
    font-weight: 700;
    text-align: center;
}

.barcode-result-box {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.barcode-result-type {
    margin-bottom: 20px;
    text-align: center;
}

.type-badge {
    display: inline-block;
    background: linear-gradient(135deg, #FF5722 0%, #E64A19 100%);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
}

.barcode-result-content {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 2px solid #e0e0e0;
}

.result-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
    font-weight: 600;
}

.result-value {
    font-family: 'Courier New', monospace;
    font-size: 24px;
    color: #FF5722;
    font-weight: 700;
    word-wrap: break-word;
}

.barcode-result-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.barcode-result-details {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
    border: 2px solid #FFCCBC;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.detail-label {
    font-weight: 700;
    color: #FF5722;
}

.detail-value {
    color: #666;
    font-family: 'Courier New', monospace;
}

/* Buttons */
.barcode-btn {
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.barcode-btn-primary {
    background: linear-gradient(135deg, #FF5722 0%, #E64A19 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 87, 34, 0.3);
}

.barcode-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 87, 34, 0.4);
}

.barcode-btn-secondary {
    background: white;
    color: #FF5722;
    border: 3px solid #FF5722;
}

.barcode-btn-secondary:hover {
    background: #FF5722;
    color: white;
    transform: translateY(-2px);
}

.barcode-btn-action {
    background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.barcode-btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.barcode-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* History Section */
.barcode-history-section {
    background: white;
    padding: 35px;
    border-radius: 20px;
    margin-bottom: 30px;
    border: 2px solid #f0f0f0;
}

.barcode-history-section h3 {
    color: #FF5722;
    font-size: 24px;
    margin-bottom: 20px;
    font-weight: 700;
}

.barcode-history-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.history-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s;
    cursor: pointer;
}

.history-item:hover {
    border-color: #FF5722;
    transform: translateX(5px);
}

.history-time {
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
}

.history-content {
    font-size: 14px;
    color: #333;
    font-weight: 600;
    word-wrap: break-word;
}

.history-format {
    display: inline-block;
    background: #FFCCBC;
    color: #E64A19;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    margin-top: 8px;
}

/* Info Box */
.barcode-info-box {
    background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%);
    border-left: 5px solid #FF9800;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.barcode-info-box h4 {
    color: #E65100;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 700;
}

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

.info-item {
    background: white;
    padding: 20px;
    border-radius: 12px;
    line-height: 1.7;
    font-size: 14px;
    color: #555;
}

.info-item strong {
    color: #E65100;
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
}

/* Barcode Types Section */
.barcode-types-section {
    background: white;
    padding: 35px;
    border-radius: 20px;
    margin-bottom: 30px;
    border: 2px solid #f0f0f0;
}

.barcode-types-section h3 {
    color: #FF5722;
    font-size: 24px;
    margin-bottom: 25px;
    font-weight: 700;
    text-align: center;
}

.barcode-types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.barcode-type-card {
    background: linear-gradient(135deg, #FBE9E7 0%, #FFCCBC 100%);
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.barcode-type-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 87, 34, 0.2);
    border-color: #FF5722;
}

.type-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.type-name {
    font-weight: 700;
    color: #FF5722;
    font-size: 14px;
    margin-bottom: 5px;
}

.type-desc {
    font-size: 12px;
    color: #666;
}

/* Notification */
.barcode-notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
    color: white;
    padding: 18px 25px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    font-size: 16px;
    font-weight: 600;
    z-index: 10000;
    animation: slideInUp 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 400px;
}

@keyframes slideInUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.barcode-notification.hide {
    animation: slideOutDown 0.3s ease-out;
}

@keyframes slideOutDown {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(100px);
        opacity: 0;
    }
}

.barcode-notification.warning {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
}

.barcode-notification.error {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
}

/* SEO Content Section */
.seo-content {
    padding: 80px 20px;
    background: white;
}

.content-article {
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.8;
}

.content-article h2 {
    font-size: 32px;
    font-weight: 800;
    margin-top: 50px;
    margin-bottom: 20px;
    color: #333;
}

.content-article h2:first-child {
    margin-top: 0;
}

.content-article h3 {
    font-size: 24px;
    font-weight: 700;
    margin-top: 35px;
    margin-bottom: 15px;
    color: #333;
}

.content-article p {
    margin-bottom: 20px;
    color: #666;
    font-size: 16px;
}

.content-article ul,
.content-article ol {
    margin-bottom: 25px;
    padding-left: 30px;
    color: #666;
}

.content-article li {
    margin-bottom: 12px;
    line-height: 1.8;
}

.content-article strong {
    color: #333;
    font-weight: 700;
}

/* Related Tools */
.related-tools {
    max-width: 900px;
    margin: 60px auto 0;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 15px;
}

.related-tools h3 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 30px;
    text-align: center;
}

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

.related-tool-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 25px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    transition: all 0.3s;
    text-align: center;
    text-decoration: none;
}

.related-tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-color: #FF5722;
}

.related-tool-card .tool-icon {
    font-size: 42px;
}

.related-tool-card .tool-name {
    font-weight: 700;
    color: #333;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .barcode-types-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
}

@media (max-width: 768px) {
    .tool-header h1 {
        font-size: 32px;
    }
    
    .tool-subtitle {
        font-size: 16px;
    }
    
    .tool-icon-large {
        font-size: 52px;
    }
    
    .tool-meta {
        font-size: 14px;
    }

    .barcode-scanner-header h2 {
        font-size: 28px;
    }
    
    .barcode-scanner-body {
        padding: 30px 20px;
    }
    
    .barcode-scan-tabs {
        flex-direction: column;
        gap: 10px;
    }
    
    .barcode-scan-tab {
        padding: 15px;
    }
    
    .barcode-format-selection {
        flex-direction: column;
        align-items: stretch;
    }
    
    .barcode-format-selection select {
        width: 100%;
    }
    
    .barcode-camera-controls,
    .barcode-result-actions {
        flex-direction: column;
    }
    
    .barcode-btn {
        width: 100%;
    }
    
    .result-value {
        font-size: 18px;
    }
    
    .barcode-types-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .content-article h2 {
        font-size: 26px;
    }
    
    .content-article h3 {
        font-size: 20px;
    }
    
    .related-tools-grid {
        grid-template-columns: 1fr;
    }
    
    .barcode-notification {
        bottom: 20px;
        right: 20px;
        left: 20px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .barcode-scanner-header {
        padding: 35px 20px;
    }
    
    .barcode-scanner-header h2 {
        font-size: 24px;
    }
    
    .barcode-upload-box {
        padding: 40px 20px;
    }
    
    .barcode-upload-icon {
        font-size: 56px;
    }
    
    .barcode-result-section {
        padding: 25px 20px;
    }
    
    .barcode-result-box {
        padding: 20px;
    }
    
    .barcode-types-grid {
        grid-template-columns: 1fr;
    }
}