/* ====================================
   Scientific Calculator - Complete Styling
   ==================================== */

/* 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: #2563eb;
}

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

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

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

.tool-header::before {
    content: '🔢➗';
    position: absolute;
    font-size: 300px;
    opacity: 0.05;
    top: -50px;
    right: -50px;
    animation: rotate 20s linear infinite;
}

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

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

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

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

.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;
}

/* Calculator Root */
.calculator-root {
    max-width: 500px;
    margin: 0 auto;
}

/* Calculator Body - Casio Style */
.calculator-body {
    background: linear-gradient(145deg, #3a4a5a, #2c3d4e);
    border-radius: 20px;
    padding: 25px 20px;
    box-shadow: 
        0 20px 60px rgba(0,0,0,0.3),
        inset 0 1px 0 rgba(255,255,255,0.1);
    margin-bottom: 30px;
    border: 3px solid #1a2530;
}

/* Display */
.calculator-display {
    background: #c8d4a8;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 
        inset 0 2px 5px rgba(0,0,0,0.3),
        0 1px 0 rgba(255,255,255,0.1);
    min-height: 80px;
    font-family: 'Courier New', monospace;
}

.display-header {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 700;
    color: #2d3d1f;
    margin-bottom: 8px;
}

.mode-indicator {
    background: rgba(0,0,0,0.1);
    padding: 2px 6px;
    border-radius: 3px;
}

.memory-indicator {
    font-weight: 700;
    min-width: 15px;
}

.display-expression {
    font-size: 14px;
    color: #3d4d2f;
    min-height: 18px;
    word-wrap: break-word;
    margin-bottom: 5px;
}

.display-result {
    font-size: 28px;
    font-weight: 700;
    color: #1a2a0f;
    text-align: right;
    word-wrap: break-word;
}

/* Keyboard */
.calculator-keyboard {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

/* Keys */
.key {
    aspect-ratio: 1;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.1s;
    box-shadow: 
        0 3px 0 rgba(0,0,0,0.3),
        inset 0 1px 0 rgba(255,255,255,0.2);
    position: relative;
    top: 0;
}

.key:active,
.key.active {
    top: 3px;
    box-shadow: 
        0 0 0 rgba(0,0,0,0.3),
        inset 0 1px 0 rgba(255,255,255,0.2);
}

/* Number Keys - Light Gray */
.key-num {
    background: linear-gradient(145deg, #e0e0e0, #c8c8c8);
    color: #1f2937;
}

.key-num:hover {
    background: linear-gradient(145deg, #e8e8e8, #d0d0d0);
}

/* Operation Keys - Orange */
.key-op {
    background: linear-gradient(145deg, #f59e0b, #d97706);
    color: white;
    font-size: 16px;
}

.key-op:hover {
    background: linear-gradient(145deg, #fbbf24, #f59e0b);
}

/* Scientific Function Keys - Dark Blue */
.key-sci {
    background: linear-gradient(145deg, #374151, #1f2937);
    color: #fbbf24;
    font-size: 11px;
}

.key-sci:hover {
    background: linear-gradient(145deg, #4b5563, #374151);
}

/* Function Keys - Dark Gray */
.key-func {
    background: linear-gradient(145deg, #6b7280, #4b5563);
    color: white;
    font-size: 11px;
}

.key-func:hover {
    background: linear-gradient(145deg, #9ca3af, #6b7280);
}

/* Memory Keys - Purple */
.key-mem {
    background: linear-gradient(145deg, #7c3aed, #6d28d9);
    color: white;
    font-size: 11px;
}

.key-mem:hover {
    background: linear-gradient(145deg, #8b5cf6, #7c3aed);
}

/* Constant Keys - Cyan */
.key-const {
    background: linear-gradient(145deg, #06b6d4, #0891b2);
    color: white;
    font-size: 14px;
}

.key-const:hover {
    background: linear-gradient(145deg, #22d3ee, #06b6d4);
}

/* Equal Key - Green */
.key-equal {
    background: linear-gradient(145deg, #10b981, #059669);
    color: white;
    font-size: 20px;
    grid-row: span 1;
}

.key-equal:hover {
    background: linear-gradient(145deg, #34d399, #10b981);
}

/* Info Box */
.info-box {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left: 5px solid #f59e0b;
    padding: 30px;
    border-radius: 15px;
    margin-top: 30px;
}

.info-box h4 {
    color: #b45309;
    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;
    border: 2px solid rgba(245, 158, 11, 0.2);
}

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

/* 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: 40px;
    margin-bottom: 20px;
    color: #333;
}

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

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

.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;
    color: #2563eb;
}

.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: #2563eb;
}

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

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

/* Notification Toast */
.notification-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    font-size: 14px;
    font-weight: 600;
    z-index: 10000;
    animation: slideInUp 0.3s ease-out;
}

.notification-toast.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .tool-header h1 {
        font-size: 32px;
    }
    
    .tool-subtitle {
        font-size: 16px;
    }
    
    .tool-icon-large {
        font-size: 52px;
    }
    
    .calculator-root {
        max-width: 100%;
    }
    
    .calculator-body {
        padding: 20px 15px;
    }
    
    .calculator-keyboard {
        gap: 6px;
    }
    
    .key {
        font-size: 11px;
    }
    
    .display-result {
        font-size: 24px;
    }
    
    .content-article h2 {
        font-size: 26px;
    }
}

@media (max-width: 520px) {
    .tool-header {
        padding: 40px 20px;
    }
    
    .tool-header h1 {
        font-size: 28px;
    }
    
    .tool-meta {
        flex-direction: column;
        gap: 8px;
    }
    
    .meta-separator {
        display: none;
    }
    
    .calculator-keyboard {
        gap: 4px;
    }
    
    .key {
        font-size: 10px;
    }
    
    .key-op {
        font-size: 14px;
    }
    
    .key-equal {
        font-size: 18px;
    }
    
    .display-result {
        font-size: 20px;
    }
    
    .notification-toast {
        bottom: 20px;
        right: 20px;
        left: 20px;
        font-size: 13px;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Print Styles */
@media print {
    .tool-header,
    .info-box,
    .related-tools,
    .notification-toast {
        display: none;
    }
}

/* Accessibility */
.key:focus {
    outline: 3px solid #2563eb;
    outline-offset: 2px;
}