/* Future Green Tech - Tools Page Styles */

/* Tool Cards Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0;
    transition: opacity 0.2s;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.tool-card:hover::before {
    opacity: 1;
}

.tool-card.featured {
    border-color: var(--primary);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(10,143,72,0.05) 100%);
}

.tool-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
}

.tool-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.tool-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.tool-features {
    list-style: none;
    margin: 0 0 1.5rem 0;
    padding: 0;
}

.tool-features li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.tool-features li i {
    color: var(--success);
    font-size: 0.875rem;
}

.tool-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--bg-tertiary);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

.tool-badge.free {
    background: rgba(10,143,72,0.1);
    color: var(--success);
}

.tool-badge.pro {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
}

/* Tool Interface Styles */
.tool-interface {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

.tool-header {
    text-align: center;
    margin-bottom: 3rem;
}

.tool-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.tool-header h1 i {
    color: var(--primary);
}

.tool-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Input Sections */
.input-section {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
}

.input-section h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.input-section h3 i {
    color: var(--primary);
}

/* Form Elements for Tools */
.product-input-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.product-input-row input,
.product-input-row select {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
}

.product-input-row input:focus,
.product-input-row select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(10,143,72,0.1);
}

.btn-add-product {
    padding: 0.75rem 1.25rem;
    background: var(--bg-tertiary);
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.btn-add-product:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(10,143,72,0.05);
}

/* Results Display */
.results-container {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(10,143,72,0.02) 100%);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-top: 2rem;
}

.score-display {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
}

.score-circle {
    width: 200px;
    height: 200px;
    margin: 0 auto 2rem;
    position: relative;
    border-radius: 50%;
    background: conic-gradient(var(--primary) 0%, var(--accent) var(--score-deg), var(--bg-tertiary) var(--score-deg));
    display: flex;
    align-items: center;
    justify-content: center;
}

.score-circle::before {
    content: '';
    position: absolute;
    width: 160px;
    height: 160px;
    background: var(--bg-primary);
    border-radius: 50%;
}

.score-value {
    position: relative;
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--primary);
}

.score-label {
    text-align: center;
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.score-grade {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border-radius: 30px;
    font-weight: 700;
    font-size: 1.125rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.score-grade.excellent { background: rgba(10,143,72,0.15); color: var(--success); }
.score-grade.good { background: rgba(59,130,246,0.15); color: #3b82f6; }
.score-grade.average { background: rgba(245,158,11,0.15); color: #f59e0b; }
.score-grade.poor { background: rgba(239,68,68,0.15); color: #ef4444; }

/* Analysis Sections */
.analysis-section {
    margin-bottom: 2rem;
}

.analysis-section h4 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.analysis-section h4 i {
    color: var(--primary);
}

.analysis-content {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Carbon Explorer Specific */
.explorer-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.explorer-filters input,
.explorer-filters select {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.carbon-data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.carbon-data-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    transition: transform 0.2s;
}

.carbon-data-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}

.carbon-metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.carbon-metric-label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.carbon-metric-value {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1.125rem;
}

.carbon-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
}

.carbon-trend.up {
    background: rgba(239,68,68,0.1);
    color: #ef4444;
}

.carbon-trend.down {
    background: rgba(10,143,72,0.1);
    color: var(--success);
}

/* Company Tracker */
.company-search {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.company-search input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
}

.company-search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(10,143,72,0.1);
}

.company-filters {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.filter-chip {
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.filter-chip:hover,
.filter-chip.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.company-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.company-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    transition: all 0.2s;
}

.company-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.company-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.company-logo {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary);
}

.company-info h4 {
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.company-info span {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.company-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.company-metric {
    text-align: center;
}

.company-metric-value {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1rem;
}

.company-metric-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Advisor Chat Interface */
.advisor-chat {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    height: 500px;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.chat-message {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    animation: fadeIn 0.3s ease;
}

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

.chat-message.user {
    flex-direction: row-reverse;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-message.assistant .chat-avatar {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
}

.chat-message.user .chat-avatar {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.chat-bubble {
    max-width: 70%;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    line-height: 1.6;
}

.chat-message.assistant .chat-bubble {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
}

.chat-message.user .chat-bubble {
    background: var(--primary);
    color: white;
}

.chat-input-container {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: 0.75rem;
}

.chat-input-container input {
    flex: 1;
    padding: 0.875rem 1.25rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 1rem;
}

.chat-input-container button {
    padding: 0.875rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.2s;
    font-weight: 600;
}

.chat-input-container button:hover {
    background: var(--primary-dark);
}

/* Suggested Questions */
.suggested-questions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
}

.suggested-question {
    padding: 0.625rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.suggested-question:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(10,143,72,0.05);
}

/* Loading States */
.loading-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* Error States */
.error-message {
    padding: 1rem 1.25rem;
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.2);
    border-radius: var(--radius-md);
    color: #ef4444;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

/* API Status Indicator */
.api-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.875rem;
    background: var(--bg-tertiary);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.api-status.online {
    background: rgba(10,143,72,0.1);
    color: var(--success);
}

.api-status.offline {
    background: rgba(239,68,68,0.1);
    color: #ef4444;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 2s ease infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .product-input-row {
        grid-template-columns: 1fr;
    }
    
    .company-search {
        flex-direction: column;
    }
    
    .explorer-filters {
        grid-template-columns: 1fr;
    }
    
    .company-grid {
        grid-template-columns: 1fr;
    }
    
    .tool-header h1 {
        font-size: 1.75rem;
        flex-direction: column;
    }
    
    .score-circle {
        width: 160px;
        height: 160px;
    }
    
    .score-circle::before {
        width: 130px;
        height: 130px;
    }
    
    .score-value {
        font-size: 2.5rem;
    }
}
