/* Molecular Weight Calculator Specific Styles */

.tool-page {
    padding-top: 0;
}

.breadcrumb {
    padding: 20px 0;
    font-size: 14px;
    color: var(--text-gray);
}

.breadcrumb a {
    color: var(--text-gray);
    transition: var(--transition);
}

.breadcrumb a:hover {
    color: var(--primary-purple);
}

.breadcrumb .separator {
    margin: 0 10px;
    color: var(--border-color);
}

.breadcrumb .current {
    color: var(--text-dark);
    font-weight: 600;
}

.tool-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 60px 20px;
    text-align: center;
}

.tool-header-content {
    max-width: 800px;
    margin: 0 auto;
}

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

@keyframes orbit {
    0%, 100% { transform: rotate(0deg) translateX(10px) rotate(0deg); }
    50% { transform: rotate(180deg) translateX(10px) rotate(-180deg); }
}

.tool-header h1 {
    font-size: 48px;
    font-weight: 900;
    margin-bottom: 15px;
}

.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 Container */
.calculator-container {
    max-width: 1000px;
    margin: 0 auto;
}

/* Quick Guide */
.quick-guide {
    background: linear-gradient(135deg, #e0e7ff 0%, #ffffff 100%);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.quick-guide h3 {
    font-size: 24px;
    font-weight: 800;
    color: #667eea;
    margin-bottom: 20px;
}

.guide-steps {
    display: grid;
    gap: 15px;
}

.guide-step {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.step-number {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    font-weight: 800;
    font-size: 18px;
}

.step-text {
    color: #555;
    font-size: 15px;
    line-height: 1.6;
}

/* Calculator Section */
.calculator-section {
    background: white;
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
}

.input-section h2 {
    font-size: 28px;
    font-weight: 800;
    color: #333;
    margin-bottom: 25px;
}

.formula-input-wrapper {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

#formulaInput {
    flex: 1;
    padding: 18px 25px;
    border: 3px solid #e0e0e0;
    border-radius: 15px;
    font-size: 18px;
    font-family: 'Courier New', monospace;
    transition: all 0.3s;
}

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

.calculate-btn {
    padding: 18px 35px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.calculate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.calculate-btn:active {
    transform: translateY(-1px);
}

.btn-icon {
    font-size: 22px;
}

.input-hints {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.input-hints p {
    margin: 8px 0;
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

.input-hints strong {
    color: #333;
    font-weight: 700;
}

/* Compounds Library */
.compounds-library {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 2px solid #f0f0f0;
}

.compounds-library h3 {
    font-size: 24px;
    font-weight: 800;
    color: #333;
    margin-bottom: 20px;
}

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

.compound-btn {
    padding: 20px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.compound-btn:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, #e0e7ff 0%, #ffffff 100%);
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.2);
}

.compound-name {
    font-weight: 700;
    color: #333;
    font-size: 14px;
}

.compound-formula {
    font-family: 'Courier New', monospace;
    color: #667eea;
    font-size: 13px;
    font-weight: 600;
}

/* Result Section */
.result-section {
    margin-top: 40px;
    padding: 40px;
    background: linear-gradient(135deg, #e0e7ff 0%, #ffffff 100%);
    border-radius: 20px;
    border: 3px solid #667eea;
}

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

.result-header h2 {
    font-size: 28px;
    font-weight: 800;
    color: #667eea;
}

.clear-btn {
    padding: 10px 25px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

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

/* Molecular Weight Display */
.molecular-weight-display {
    padding: 40px;
    background: white;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    text-align: center;
}

.formula-display {
    font-family: 'Courier New', monospace;
    font-size: 36px;
    font-weight: 700;
    color: #333;
    margin-bottom: 20px;
}

.weight-value {
    font-size: 48px;
    font-weight: 900;
    color: #667eea;
    margin-bottom: 10px;
}

.weight-unit {
    font-size: 24px;
    color: #666;
    font-weight: 600;
}

.message {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

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

/* Result Details */
.result-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.detail-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.detail-card.full-width {
    grid-column: 1 / -1;
}

.detail-card h4 {
    font-size: 18px;
    font-weight: 800;
    color: #667eea;
    margin-bottom: 15px;
}

/* Element Breakdown */
.element-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.element-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

.element-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.element-symbol {
    font-weight: 700;
    color: #333;
    font-size: 18px;
    min-width: 40px;
}

.element-count {
    font-size: 14px;
    color: #666;
}

.element-weight {
    font-weight: 700;
    color: #667eea;
    font-size: 16px;
}

/* Percentage Bar */
.percentage-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.percentage-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.percentage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.percentage-element {
    font-weight: 700;
    color: #333;
    font-size: 15px;
}

.percentage-value {
    font-weight: 700;
    color: #667eea;
    font-size: 15px;
}

.percentage-bar {
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
}

.percentage-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 5px;
    transition: width 0.6s ease;
}

/* Formula Info */
.formula-info-grid {
    display: grid;
    gap: 12px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

.info-label {
    font-weight: 600;
    color: #666;
}

.info-value {
    font-weight: 700;
    color: #333;
}

/* Stoichiometry Helper */
.stoich-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.stoich-card {
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e0e7ff 50%);
    border-radius: 12px;
    text-align: center;
    border: 2px solid #e0e0e0;
}

.stoich-card h5 {
    font-size: 14px;
    font-weight: 700;
    color: #666;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stoich-value {
    font-size: 24px;
    font-weight: 900;
    color: #667eea;
}

.stoich-unit {
    font-size: 14px;
    color: #666;
    font-weight: 600;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.action-btn {
    flex: 1;
    min-width: 150px;
    padding: 15px 25px;
    background: white;
    color: #333;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.action-btn:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.action-btn span {
    font-size: 20px;
}

/* Info Box */
.info-box {
    margin-top: 40px;
    padding: 30px;
    background: white;
    border-radius: 20px;
    border-left: 5px solid #667eea;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
}

.info-box h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 24px;
    font-weight: 800;
}

.info-box h4 {
    color: #333;
    margin-top: 25px;
    margin-bottom: 12px;
    font-size: 18px;
    font-weight: 700;
}

.info-box p {
    color: #555;
    line-height: 1.8;
    margin-bottom: 15px;
}

.info-box ul {
    margin: 0;
    padding-left: 25px;
    color: #555;
}

.info-box li {
    margin-bottom: 10px;
    line-height: 1.7;
}

.info-box strong {
    color: #333;
}

/* SEO Content */
.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: var(--text-dark);
}

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

.content-article h3 {
    font-size: 24px;
    font-weight: 700;
    margin-top: 35px;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.content-article p {
    margin-bottom: 20px;
    color: var(--text-gray);
    font-size: 16px;
}

.content-article ul {
    margin-bottom: 25px;
    padding-left: 30px;
    color: var(--text-gray);
}

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

.content-article strong {
    color: var(--text-dark);
    font-weight: 700;
}

.related-tools {
    max-width: 900px;
    margin: 60px auto 0;
    padding: 40px;
    background: var(--bg-light);
    border-radius: var(--border-radius);
}

.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(180px, 1fr));
    gap: 20px;
}

.related-tool-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 25px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
    text-align: center;
}

.related-tool-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: #667eea;
}

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

.related-tool-card .tool-name {
    font-weight: 700;
    color: var(--text-dark);
}

/* Subscript/Superscript in formulas */
sub {
    font-size: 0.75em;
    vertical-align: sub;
}

sup {
    font-size: 0.75em;
    vertical-align: super;
}

/* Loading Animation */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tool-header h1 {
        font-size: 32px;
    }
    
    .tool-subtitle {
        font-size: 16px;
    }
    
    .calculator-section {
        padding: 25px;
    }
    
    .formula-input-wrapper {
        flex-direction: column;
    }
    
    #formulaInput {
        font-size: 16px;
    }
    
    .calculate-btn {
        width: 100%;
        justify-content: center;
    }
    
    .compounds-grid {
        grid-template-columns: 1fr;
    }
    
    .result-details {
        grid-template-columns: 1fr;
    }
    
    .molecular-weight-display {
        padding: 25px;
    }
    
    .formula-display {
        font-size: 28px;
    }
    
    .weight-value {
        font-size: 36px;
    }
    
    .stoich-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
    }
    
    .content-article h2 {
        font-size: 26px;
    }
    
    .content-article h3 {
        font-size: 20px;
    }
    
    .related-tools-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .tool-header {
        padding: 40px 20px;
    }
    
    .tool-header h1 {
        font-size: 26px;
    }
    
    .tool-icon-large {
        font-size: 56px;
    }
    
    .quick-guide {
        padding: 20px;
    }
    
    .guide-step {
        flex-direction: column;
        text-align: center;
    }
    
    .calculator-section {
        padding: 20px;
    }
    
    #formulaInput {
        padding: 15px 20px;
        font-size: 14px;
    }
    
    .calculate-btn {
        padding: 15px 25px;
        font-size: 16px;
    }
    
    .molecular-weight-display {
        padding: 20px;
    }
    
    .formula-display {
        font-size: 24px;
    }
    
    .weight-value {
        font-size: 32px;
    }
    
    .result-section {
        padding: 25px;
    }
}

/* Print Styles */
@media print {
    .tool-header,
    .breadcrumb,
    .quick-guide,
    .input-section,
    .compounds-library,
    .action-buttons,
    .info-box,
    .seo-content {
        display: none !important;
    }
    
    .result-section {
        border: 1px solid #333;
        box-shadow: none;
        page-break-inside: avoid;
    }
}