/* ==========================================================================
   Base Styles and Variables
   ========================================================================== */
:root {
    --primary-color: #00b764;
    --secondary-color: #00203f;
    --accent-color: #ff6f61;
    --text-color: #2d3436;
    --bg-color: #f0f3ff;
    --card-bg: white;
    --border-color: #ddd;
    --highlight-color: #f0fff4;
    --transition-speed: 0.3s;
    --border-radius: 12px;
    --box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* --- Global Reset & Styles --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'DM Sans', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background var(--transition-speed), color var(--transition-speed);
}

/* --- Container Styling --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* --- Header Styling --- */
header {
    text-align: center;
    margin-bottom: 40px;
}

h1 {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

header p {
    font-size: 1.2rem;
    color: var(--accent-color);
}

/* --- Card-Based Layout --- */
.card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 25px;
    margin-bottom: 30px;
    transition: transform 0.3s ease-in-out;
}

.card:hover {
    transform: scale(1.02);
}

/* --- Input Section --- */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

input {
    width: 100%;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color var(--transition-speed);
}

input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 5px var(--primary-color);
}

/* --- Buttons --- */
button {
    width: 100%;
    padding: 0px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    cursor: pointer;
    transition: background-color var(--transition-speed), transform 0.2s ease-in-out;
}

button:hover {
    background-color: var(--secondary-color);
    transform: scale(1.05);
}

/* --- Results Section --- */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* --- Metric Cards --- */
.metric-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    text-align: center;
    transition: transform 0.3s ease-in-out;
}

.metric-card:hover {
    transform: scale(1.03);
}

.score {
    font-size: 1.8rem;
    font-weight: bold;
    margin: 10px 0;
}

.score.excellent { color: #00c853; }
.score.average { color: #ffd600; }
.score.poor { color: #ff1744; }

/* --- Footer Styling --- */
footer {
    text-align: center;
    margin-top: 40px;
    color: var(--text-color);
    font-size: 0.9rem;
}

/* --- Responsive Design --- */
@media (max-width: 1024px) {
    .container {
        padding: 15px;
    }

    h1 {
        font-size: 2.2rem;
    }

    .card {
        padding: 20px;
    }

    button {
        font-size: 16px;
        padding: 0px;
    }
}

@media (max-width: 768px) {
    .container {
        width: 90%;
        padding: 10px;
    }

    h1 {
        font-size: 2rem;
    }

    input, button {
        width: 100%;
    }

    .results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.8rem;
    }

    header p {
        font-size: 1rem;
    }

    .results-grid {
        grid-template-columns: repeat(1, 1fr);
    }

    .card {
        padding: 18px;
    }
}

/* Tab Navigation Styles */
.tab-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin: 25px auto;
    padding: 0 20px;
    max-width: 1200px;
}

.tab-button {
    flex: 1;
    min-width: 200px;
    padding: 15px 30px;
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    background-color: transparent;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.tab-button:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
}

.tab-button:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.tab-button:hover:before {
    left: 0;
}

.tab-button.active {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.tab-button:active {
    transform: translateY(0);
}

/* Tab Content Styles */
.tab-content {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-content.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .tab-navigation {
        flex-direction: column;
        gap: 10px;
        padding: 0 15px;
    }

    .tab-button {
        width: 100%;
        min-width: unset;
        padding: 12px 20px;
        font-size: 14px;
    }
}

/* Enhanced Animation */
@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Add smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Add loading animation for tab content */
.tab-content.loading {
    position: relative;
}

.tab-content.loading:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    border: 3px solid var(--primary-color);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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


/* Enhanced Dashboard Styling */
.input-dashboard {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--box-shadow);
}

.dashboard-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    background: linear-gradient(to right, #ffffff, #f8f9fa);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border-radius: 15px;
}

.dashboard-header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 
                0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.header-wrapper {
    max-width: 100%;
    margin: 0 auto;
    padding: 1rem 1.5rem;
}

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

.title-section {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.title-section h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.subtitle {
    font-size: 0.875rem;
    color: #718096;
    font-weight: 400;
}

.quick-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    border: none;
    font-weight: 500;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.action-btn:hover::before {
    width: 300%;
    height: 300%;
}

.action-btn.primary {
    background: linear-gradient(135deg, #0070f3 0%, #00a6ff 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(0, 112, 243, 0.1);
}

.action-btn.secondary {
    background: linear-gradient(135deg, #64748b 0%, #94a3b8 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(100, 116, 139, 0.1);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.action-btn:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 1.125rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-text {
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* Add scroll animation */
@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive styles */
@media (max-width: 768px) {
    .header-wrapper {
        padding: 0.75rem 1rem;
    }

    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .title-section {
        align-items: center;
    }

    .quick-actions {
        width: 100%;
        justify-content: center;
        gap: 0.75rem;
    }

    .action-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .quick-actions {
        flex-direction: column;
        width: 100%;
    }

    .action-btn {
        width: 100%;
        justify-content: center;
    }
}


.smart-form {
    padding: 20px;
    background: #fff;
    border-radius: 12px;
}

.form-section {
    margin-bottom: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.form-section:hover {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.input-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 10px;
}

.form-group {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #444;
}

.number-input {
    display: flex;
    align-items: center;
    gap: 8px;
}

.number-input button {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.number-input button:hover {
    background: var(--secondary-color);
}

.number-input input {
    width: 80px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 6px;
}

.action-btn.primary {
    background: var(--primary-color);
    color: white;
}

@media (max-width: 768px) {
    .smart-form {
        padding: 15px;
    }
    
    .input-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

.smart-form {
    padding: 20px;
    background: #fff;
    border-radius: 12px;
}

.form-section {
    margin-bottom: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.form-section:hover {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.input-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 10px;
}

.form-group {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #444;
}

.number-input {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center
}

.form-group label{
    text-align: center !important;
}

.number-input button {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.number-input button:hover {
    background: var(--secondary-color);
}

.number-input input {
    width: 80px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 6px;
}

.action-btn.primary {
    background: var(--primary-color);
    color: white;
}

/* ==========================================================================
   Popup Component
   ========================================================================== */
.custom-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    border-radius: 12px;
    min-width: 300px;
    max-width: 90%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease;
}

/* Popup Header */
.popup-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.popup-icon {
    font-size: 24px;
}

.popup-header h3 {
    margin: 0;
    flex-grow: 1;
    font-size: 1.2rem;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    line-height: 1;
}

.popup-body {
    margin-bottom: 20px;
    color: #555;
}

.popup-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.popup-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.popup-btn.cancel {
    background: #f0f0f0;
    color: #333;
}

.popup-btn.confirm {
    background: var(--primary-color);
    color: white;
}

.popup-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

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

/* ==========================================================================
   Responsive Design
   ========================================================================== */
/* Tablet and smaller */
@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        gap: 15px;
    }

    .quick-actions {
        width: 100%;
        justify-content: space-between;
    }

    .smart-form {
        padding: 15px;
    }
    
    .input-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* Mobile devices */
@media (max-width: 480px) {
    .input-dashboard {
        padding: 15px;
    }

    .action-btn {
        padding: 6px 12px;
        font-size: 0.9rem;
    }

    .popup-content {
        width: 90%;
        margin: 0px;
    }
    
    .popup-footer {
        flex-direction: column;
    }
    
    .popup-btn {
        width: 100%;
        padding: 12px;
    }
}


.analytics-inputs {
    padding: 25px;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.analytics-inputs h3 {
    color: var(--secondary-color);
    margin-bottom: 25px;
    font-size: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.analytics-category {
    background: var(--bg-color);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.analytics-category:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow);
}

.analytics-category h4 {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.input-wrapper {
    background: var(--card-bg);
    padding: 15px;
    border-radius: var(--border-radius);
}

.connection-status-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.modal-content button {
    background: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
}

.modal-content button:hover {
    background: #0056b3;
} 