/* Periodic Table 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: float 3s ease-in-out infinite;
}

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

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

/* Periodic Table Container */
.periodic-container {
    max-width: 1400px;
    margin: 0 auto;
}

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

.search-box {
    margin-bottom: 25px;
}

.search-box input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s;
}

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

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    color: #666;
}

.filter-btn:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
}

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

/* Temperature Control */
.temperature-control {
    background: white;
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.temperature-control label {
    font-weight: 700;
    color: #333;
}

#tempSlider {
    flex: 1;
    min-width: 200px;
    height: 8px;
    border-radius: 5px;
    background: linear-gradient(to right, #3498db, #e74c3c);
    outline: none;
    -webkit-appearance: none;
}

#tempSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

#tempSlider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

#tempValue {
    font-weight: 700;
    color: #667eea;
    font-size: 18px;
    min-width: 80px;
}

.state-indicators {
    display: flex;
    gap: 20px;
    font-size: 14px;
}

.state-solid { color: #8B4513; font-weight: 600; }
.state-liquid { color: #3498db; font-weight: 600; }
.state-gas { color: #e74c3c; font-weight: 600; }

/* Periodic Table Wrapper */
.periodic-table-wrapper {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    overflow-x: auto;
}

/* Periodic Table Grid */
.periodic-table {
    display: grid;
    grid-template-columns: repeat(18, 1fr);
    gap: 5px;
    min-width: 1100px;
}

/* Element Box */
.element {
    aspect-ratio: 1;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    position: relative;
    background: white;
}

.element:hover {
    transform: scale(1.15);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    z-index: 10;
}

.element.highlight {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7); }
    50% { box-shadow: 0 0 0 10px rgba(102, 126, 234, 0); }
}

.element.dimmed {
    opacity: 0.3;
}

.atomic-number {
    font-size: 10px;
    color: #666;
    font-weight: 600;
}

.element-symbol {
    font-size: 24px;
    font-weight: 900;
    color: #333;
}

.element-name {
    font-size: 9px;
    color: #666;
    font-weight: 600;
    text-align: center;
}

.atomic-mass {
    font-size: 9px;
    color: #999;
}

/* Empty cells */
.empty {
    background: transparent;
    border: none;
    cursor: default;
}

.empty:hover {
    transform: none;
    box-shadow: none;
}

/* Category Colors */
.alkali-metal {
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    color: white !important;
}

.alkaline-earth {
    background: linear-gradient(135deg, #feca57, #ff9ff3);
    color: #333 !important;
}

.transition {
    background: linear-gradient(135deg, #48dbfb, #0abde3);
    color: white !important;
}

.post-transition {
    background: linear-gradient(135deg, #00d2d3, #1dd1a1);
    color: white !important;
}

.metalloid {
    background: linear-gradient(135deg, #fdcb6e, #e17055);
    color: white !important;
}

.nonmetal {
    background: linear-gradient(135deg, #a29bfe, #6c5ce7);
    color: white !important;
}

.halogen {
    background: linear-gradient(135deg, #fd79a8, #e84393);
    color: white !important;
}

.noble-gas {
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    color: white !important;
}

.lanthanide {
    background: linear-gradient(135deg, #fab1a0, #e17055);
    color: white !important;
}

.actinide {
    background: linear-gradient(135deg, #a29bfe, #6c5ce7);
    color: white !important;
}

/* Override text colors for colored backgrounds */
.alkali-metal .atomic-number,
.alkali-metal .element-name,
.alkali-metal .atomic-mass,
.transition .atomic-number,
.transition .element-name,
.transition .atomic-mass,
.post-transition .atomic-number,
.post-transition .element-name,
.post-transition .atomic-mass,
.metalloid .atomic-number,
.metalloid .element-name,
.metalloid .atomic-mass,
.nonmetal .atomic-number,
.nonmetal .element-name,
.nonmetal .atomic-mass,
.halogen .atomic-number,
.halogen .element-name,
.halogen .atomic-mass,
.noble-gas .atomic-number,
.noble-gas .element-name,
.noble-gas .atomic-mass,
.lanthanide .atomic-number,
.lanthanide .element-name,
.lanthanide .atomic-mass,
.actinide .atomic-number,
.actinide .element-name,
.actinide .atomic-mass {
    color: rgba(255,255,255,0.9) !important;
}

.alkali-metal .element-symbol,
.transition .element-symbol,
.post-transition .element-symbol,
.metalloid .element-symbol,
.nonmetal .element-symbol,
.halogen .element-symbol,
.noble-gas .element-symbol,
.lanthanide .element-symbol,
.actinide .element-symbol {
    color: white !important;
}

/* Phase indicators */
.element.phase-solid {
    border-color: #8B4513;
    border-width: 3px;
}

.element.phase-liquid {
    border-color: #3498db;
    border-width: 3px;
}

.element.phase-gas {
    border-color: #e74c3c;
    border-width: 3px;
}

/* Lanthanides & Actinides */
.lanthanides-actinides {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lanthanides,
.actinides {
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    gap: 5px;
}

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

.legend-section h3 {
    font-size: 24px;
    font-weight: 800;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

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

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 8px;
    background: #f8f9fa;
}

.legend-color {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 2px solid #e0e0e0;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    margin: 3% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.4s;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
}

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

.close-modal {
    color: #999;
    float: right;
    font-size: 40px;
    font-weight: 300;
    cursor: pointer;
    padding: 10px 20px;
    transition: all 0.3s;
    position: absolute;
    right: 0;
    background: white;
    width: 70px;
    height: 70px;
    padding: 10px;
    line-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    color: #333;
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    border-radius: 20px 20px 0 0;
    display: flex;
    align-items: center;
    gap: 30px;
}

.modal-element-symbol {
    font-size: 96px;
    font-weight: 900;
    background: rgba(255,255,255,0.2);
    padding: 20px 30px;
    border-radius: 15px;
    min-width: 150px;
    text-align: center;
}

.modal-element-info h2 {
    font-size: 42px;
    font-weight: 900;
    margin-bottom: 10px;
}

.modal-element-info p {
    font-size: 18px;
    opacity: 0.9;
}

.modal-body {
    padding: 40px;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

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

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

.info-card h4 {
    font-size: 20px;
    font-weight: 800;
    color: #667eea;
    margin-bottom: 20px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

.info-row:last-child {
    border-bottom: none;
}

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

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

.info-card p {
    color: #555;
    line-height: 1.8;
    font-size: 15px;
}

/* 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);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .periodic-table {
        min-width: 900px;
    }
}

@media (max-width: 768px) {
    .tool-header h1 {
        font-size: 32px;
    }
    
    .tool-subtitle {
        font-size: 16px;
    }
    
    .controls-section {
        padding: 20px;
    }
    
    .filter-buttons {
        justify-content: center;
    }
    
    .filter-btn {
        font-size: 12px;
        padding: 8px 15px;
    }
    
    .temperature-control {
        flex-direction: column;
        align-items: stretch;
    }
    
    #tempSlider {
        width: 100%;
    }
    
    .state-indicators {
        justify-content: center;
    }
    
    .periodic-table-wrapper {
        padding: 15px;
    }
    
    .periodic-table {
        min-width: 700px;
    }
    
    .element-symbol {
        font-size: 18px;
    }
    
    .element-name {
        font-size: 8px;
    }
    
    .legend-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .modal-header {
        flex-direction: column;
        padding: 30px;
        text-align: center;
    }
    
    .modal-element-symbol {
        font-size: 72px;
    }
    
    .modal-element-info h2 {
        font-size: 32px;
    }
    
    .modal-body {
        padding: 25px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .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;
    }
    
    .periodic-table {
        min-width: 600px;
    }
    
    .element {
        padding: 4px;
    }
    
    .atomic-number {
        font-size: 8px;
    }
    
    .element-symbol {
        font-size: 16px;
    }
    
    .element-name {
        font-size: 7px;
    }
    
    .atomic-mass {
        font-size: 7px;
    }
}

/* Print Styles */
@media print {
    .tool-header,
    .breadcrumb,
    .controls-section,
    .temperature-control,
    .legend-section,
    .seo-content {
        display: none !important;
    }
    
    .periodic-table-wrapper {
        box-shadow: none;
        padding: 0;
    }
}