/* WhatsApp Chat Analyzer Styles */

/* 
======================
  WhatsApp Chat Analyzer Layout
======================
*/
.analyzer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 2rem 4rem;
}

.title-section {
    text-align: center;
    margin-bottom: 3rem;
}

.title-section h1 {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: var(--font-heading);
    font-size: 3rem;
    margin-bottom: 1rem;
}

.title-section .subtitle {
    color: var(--text-secondary);
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
}

/* 
======================
  Upload Section
======================
*/
.upload-section {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 3rem;
    justify-content: center;
}

.upload-card {
    background-color: rgba(30, 30, 50, 0.6);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    flex: 1;
    min-width: 350px;
    max-width: 600px;
    text-align: center;
}

.how-to-card {
    background-color: rgba(30, 30, 50, 0.4);
    backdrop-filter: blur(5px);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    flex: 0 1 300px;
}

.upload-card h2,
.how-to-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
}

.upload-card p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.file-upload-box {
    display: flex;
    align-items: center;
    padding: 15px;
    background-color: rgba(58, 134, 255, 0.1);
    border: 2px dashed var(--primary-color);
    border-radius: var(--border-radius-md);
    margin: 15px 0;
    transition: all 0.3s ease;
}

.dark-mode .file-upload-box {
    background-color: rgba(58, 134, 255, 0.15);
}

.file-upload-box:hover {
    background-color: rgba(58, 134, 255, 0.15);
}

.file-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-right: 20px;
}

.file-info {
    flex: 1;
}

.file-info p {
    margin: 5px 0;
}

.file-status {
    color: var(--success-color);
    font-weight: 500;
    margin-top: 8px !important;
}

.file-status i {
    margin-right: 5px;
}

.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
    margin-bottom: 15px;
    width: 100%;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    background-color: rgba(58, 134, 255, 0.1);
    border: 2px dashed var(--primary-color);
    border-radius: var(--border-radius-md);
    color: var(--text-primary);
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.dark-mode .file-label {
    background-color: rgba(58, 134, 255, 0.15);
    color: white;
}

.file-label:hover {
    background-color: rgba(58, 134, 255, 0.2);
}

.file-label i {
    font-size: 1.5rem;
    margin-right: 10px;
    color: var(--primary-color);
}

#file-details {
    min-height: 60px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: var(--border-radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.primary-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.primary-btn:disabled {
    background: linear-gradient(135deg, #999, #666);
    cursor: not-allowed;
}

.how-to-card ol {
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.how-to-card li {
    margin-bottom: 0.7rem;
}

.privacy-note {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* 
======================
  Loading Indicator
======================
*/
.loading-container {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.loading-card {
    background-color: rgba(30, 30, 50, 0.6);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    max-width: 400px;
}

.loader {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 
======================
  Results Section
======================
*/
.results-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    padding-top: 1rem;
}

.results-section.hidden {
    display: none;
}

.results-section:not(.hidden) {
    opacity: 1;
    transform: translateY(0);
}

.results-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--primary-color);
    font-family: var(--font-heading);
    position: relative;
}

.results-section h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.summary-card {
    background-color: rgba(30, 30, 50, 0.6);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: var(--border-radius-md);
    text-align: center;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeIn 0.5s ease forwards;
}

.summary-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.summary-card h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.summary-card p {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
    gap: 25px;
    margin-top: 30px;
    width: 100%;
}

/* Special class for full-width visualizations */
.result-card.full-width {
    grid-column: 1 / -1;
    height: auto;
    min-height: 450px;
}

/* Make specific visualizations take full width */
#word-cloud-card,
#activity-timeline-card,
#monthly-activity-card,
#sentiment-analysis-card,
#response-time-card {
    grid-column: 1 / -1;
}

/* Ensure chart containers have proper height */
.chart-container {
    height: 350px;
    position: relative;
    margin-bottom: 15px;
    width: 100%;
}

/* For larger visualizations like wordcloud */
.full-width .chart-container {
    height: 450px;
}

/* For detailed tables below charts */
.data-container {
    overflow-x: auto;
    max-height: 300px;
    margin-top: 20px;
}

/* Improve responsiveness */
@media (max-width: 1200px) {
    .results-grid {
        grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    }
}

@media (max-width: 768px) {
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-container {
        height: 300px;
    }
    
    .full-width .chart-container {
        height: 350px;
    }
}

.result-card {
    background-color: var(--card-background);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.result-card h3 {
    margin-bottom: 15px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

/* Table styling for specific visualizations */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 0.9rem;
}

.data-table th,
.data-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background-color: rgba(var(--primary-color-rgb), 0.1);
    font-weight: 600;
    color: var(--text-primary);
}

.data-table tr:hover {
    background-color: rgba(var(--background-color-rgb), 0.5);
}

/* Error message styling */
.error-message {
    color: #dc3545;
    padding: 10px;
    border-left: 3px solid #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
    margin: 10px 0;
    grid-column: 1 / -1;
    width: 100%;
}

.error-message h3 {
    color: rgba(255, 99, 132, 1);
    margin-bottom: 5px;
    display: flex;
    align-items: center;
}

.error-message h3 i {
    margin-right: 10px;
}

.error-message p {
    margin-bottom: 10px;
}

/* Error box styling */
.error-box {
    background-color: rgba(255, 99, 132, 0.1);
    border-left: 4px solid #ff6384;
    padding: 15px;
    margin: 15px 0;
    border-radius: 8px;
}

.error-box p.error {
    color: #dc3545;
    margin: 0;
    display: flex;
    align-items: center;
}

.error-box i {
    margin-right: 8px;
    font-size: 1.2em;
}

/* Dark mode support */
.dark-mode .error-box {
    background-color: rgba(255, 99, 132, 0.2);
}

/* Simple word cloud styling */
.simple-word-cloud {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    height: 100%;
    min-height: 250px;
    gap: 10px;
    padding: 15px;
}

.word-item {
    display: inline-block;
    padding: 5px;
    border-radius: 4px;
    margin: 3px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.word-item:hover {
    transform: scale(1.1);
    opacity: 0.8;
}

/* Utility classes */
.hidden {
    display: none !important;
}

/* Dark mode support for new elements */
.dark-mode .emoji-item {
    background-color: rgba(58, 134, 255, 0.2);
}

.dark-mode .data-table tr.highlight {
    background-color: rgba(58, 134, 255, 0.2);
}

.dark-mode .error-message {
    background-color: rgba(255, 99, 132, 0.2);
}
