/* assets/css/style.css - COMPLETE Global Styles */
:root {
    --primary-color: #667eea;
    --primary-light: #8a9ff1;
    --primary-dark: #5a6fd8;
    --secondary-color: #764ba2;
    --text-color: #2d3748;
    --text-light: #718096;
    --border-color: #e2e8f0;
    --background-light: #f7fafc;
    --background-white: #ffffff;
    --success-color: #48bb78;
    --warning-color: #ed8936;
    --danger-color: #f56565;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --border-radius: 16px;
    --border-radius-sm: 12px;
    --transition: all 0.3s ease;
    
    /* Category Colors */
    --health-color: #48bb78;
    --productivity-color: #4299e1;
    --personal-color: #9f7aea;
    --learning-color: #ed8936;
    --social-color: #ed64a6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: 100%;
	font: inherit;
	vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
	display: block;
}

html {
    margin: 0 auto;
    padding: 0;
    width: 100%;
    position:relative;
}
body {
    margin: 0 auto !important;
    padding: 0  !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    width: 100%;
    position:relative;
    max-width: 600px;
}

/* App Container */
.app-container {
    width: 100%;
    margin: 0 auto;
    padding: 0;
     background: var(--background-white);
    min-height: 100vh;
    position: relative;
    
}

.screen {
    margin: 0 auto;
    display: none;
    min-height: 100vh;
    padding: 16px 16px 74px;
}

.screen.active {
    display: block;
}

/* Welcome Screen */
.welcome-screen {
    border: 1px solid green;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.welcome-content {
    max-width: 320px;
}

.logo {
    margin-bottom: 3rem;
}

.logo-icon {
    font-size: 5rem;
    margin-bottom: 1.5rem;
    display: block;
    animation: float 3s ease-in-out infinite;
}

.logo h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.tagline {
    font-size: 1.3rem;
    margin-bottom: 3rem;
    opacity: 0.9;
}

.hero-illustration {
    font-size: 5rem;
    margin: 3rem 0;
    opacity: 0.9;
}

.button-group {
    width: 100%;
}

/* Buttons */
.btn {
    display: block;
    width: 100%;
    padding: 16px 20px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    margin-bottom: 1rem;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: transparent;
    color: var(--background-white);
    border: 2px solid rgba(255,255,255,0.3);
}

.btn-secondary:hover {
    background: var(--background-white);
    color: var(--primary-color);
}

/* Forms */
.auth-form {
    margin-top: 1.5rem;
}

.input-group {
    margin-bottom: 1.2rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.input-group input, .input-group select, .input-group textarea {
    width: 100%;
    padding: 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    transition: var(--transition);
}

.input-group input:focus, .input-group select:focus, .input-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Header */
.header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0 2px;
}

.btn-back {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 6px;
    margin-right: 10px;
    color: var(--text-light);
    transition: var(--transition);
    border-radius: 50%;
    text-decoration: none;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-back:hover {
    background: var(--background-light);
}

.header h2 {
    font-size: 1.4rem;
    font-weight: 700;
}

.user-info {
    flex: 1;
    font-weight: 600;
    font-size: 1.1rem;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 10px;
    color: var(--text-light);
    transition: var(--transition);
    border-radius: 50%;
}

.btn-icon:hover {
    background: var(--background-light);
}

/* Dashboard Styles */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 16px 14px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow);
}

.stat-icon {
    font-size: 1.5rem;
    opacity: 0.9;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 0.2rem;
}

.stat-label {
    font-size: 0.8rem;
    opacity: 0.9;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
}

.habits-count {
    color: var(--primary-color);
    font-weight: 600;
}

.habits-list {
    margin-bottom: 15px;
}

.habit-item {
    display: flex;
    align-items: center;
    background: var(--background-white);
    padding: 16px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 10px;
    transition: var(--transition);
    cursor: pointer;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow);
    position: relative;
}

.habit-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.habit-item.completed {
    background: linear-gradient(135deg, #f0fff4, #c6f6d5);
    border-color: var(--success-color);
    opacity: 0.7;
}

.habit-checkbox {
    margin-right: 14px;
}

.habit-checkbox .checkbox {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border-color);
    transition: var(--transition);
}

.habit-checkbox .checkbox.checked {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.habit-info {
    flex: 1;
}

.habit-name {
    font-weight: 600;
    margin-bottom: 0.2rem;
    font-size: 1rem;
}

.habit-details {
    font-size: 0.9rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

.habit-category {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.category-health { background: var(--health-color); color: white; }
.category-productivity { background: var(--productivity-color); color: white; }
.category-personal { background: var(--personal-color); color: white; }
.category-learning { background: var(--learning-color); color: white; }
.category-social { background: var(--social-color); color: white; }

.habit-time {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 600;
    background: var(--background-light);
    padding: 6px 12px;
    border-radius: 20px;
}

.habit-streak {
    position: absolute;
    top: 8px;
    right: 8px;
    background: gold;
    color: #000;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
}

.btn-add-habit {
    width: 100%;
    padding: 20px;
    background: transparent;
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-light);
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 600;
}

.btn-add-habit:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Category Filter */
.category-filter {
    display: flex;
    gap: 8px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.category-btn {
    padding: 8px 16px;
    border: 2px solid var(--border-color);
    border-radius: 20px;
    background: var(--background-white);
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.category-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Bottom Navigation - Compact Design */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--background-white);
    display: flex;
    padding: 6px 8px;
    margin: 0 16ox;
    max-width: 400px;
    margin: 0 auto;
    z-index: 1000;
    border-radius: var(--border-radius-sm);
    height: 66px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4px 2px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    transition: all 0.2s ease;
    border-radius: 6px;
    text-decoration: none;
    position: relative;
    min-height: 44px;
    gap: 2px;
}

.nav-item:hover {
    background: var(--background-light);
}

.nav-item.active {
    color: var(--primary-color);
    background: rgba(102, 126, 234, 0.12);
    transform: translateY(-1px);
}

.nav-icon {
    font-size: 1.3rem;
    transition: transform 0.2s ease;
    line-height: 1;
}

.nav-item.active .nav-icon {
    transform: scale(1.15);
}

.nav-text {
    font-size: 0.65rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.2px;
}

/* Notification Badge */
.nav-badge {
    position: absolute;
    top: 3px;
    right: 8px;
    background: #ef4444;
    color: white;
    border-radius: 7px;
    min-width: 14px;
    height: 14px;
    font-size: 0.6rem;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 2px;
    border: 1.5px solid white;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 5px rgba(239, 68, 68, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* Error Message */
.error-message {
    background: #fed7d7;
    color: #c53030;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid #feb2b2;
}

/* Success Message */
.success-message {
    background: #c6f6d5;
    color: #22543d;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid #9ae6b4;
}

/* Enhanced Form Styles */
.validation-feedback {
    font-size: 0.8rem;
    margin-top: 4px;
    min-height: 16px;
}

.validation-feedback.error {
    color: var(--danger-color);
}

.validation-feedback.success {
    color: var(--success-color);
}

/* Password Strength Meter */
.password-strength {
    margin-top: 8px;
}

.strength-bar {
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    margin-bottom: 4px;
    transition: all 0.3s ease;
}

.strength-text {
    font-size: 0.7rem;
    color: var(--text-light);
}

.strength-weak .strength-bar { background: var(--danger-color); width: 25%; }
.strength-medium .strength-bar { background: var(--warning-color); width: 50%; }
.strength-strong .strength-bar { background: var(--success-color); width: 75%; }
.strength-very-strong .strength-bar { background: var(--success-color); width: 100%; }

.strength-weak .strength-text { color: var(--danger-color); }
.strength-medium .strength-text { color: var(--warning-color); }
.strength-strong .strength-text { color: var(--success-color); }
.strength-very-strong .strength-text { color: var(--success-color); font-weight: 600; }

/* CAPTCHA Styles */
.captcha-container {
    background: var(--background-light);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.captcha-question {
    font-size: 1rem;
    margin-bottom: 8px;
    color: var(--text-color);
}

/* Checkbox Styles */
.checkbox-group {
    margin-bottom: 1.5rem;
}

.checkbox-label {
    display: flex !important;
    align-items: center !important;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-color);
    padding: 8px 0;
    position: relative;
    min-height: 24px;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
}

.checkbox-label input[type="checkbox"] {
    opacity: 0;
    position: absolute;
    width: 20px;
    height: 20px;
    cursor: pointer;
    z-index: 2;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    margin: 0 !important;
}

.custom-checkmark {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    margin-right: 12px !important;
    position: relative;
    flex-shrink: 0 !important;
    transition: all 0.3s ease;
    background: var(--background-white);
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.checkbox-label input[type="checkbox"]:checked + .custom-checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked + .custom-checkmark::after {
    content: '✓';
    color: white;
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
}

.checkbox-label input[type="checkbox"]:focus + .custom-checkmark {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
    border-color: var(--primary-color);
}

.checkbox-text {
    display: inline !important;
    white-space: normal !important;
    line-height: 1.4;
    flex: 1;
}

.checkbox-text a {
    color: var(--primary-color);
    text-decoration: none;
    white-space: nowrap;
}

.checkbox-text a:hover {
    text-decoration: underline;
}

.validation-feedback {
    font-size: 0.8rem;
    margin-top: 4px;
    margin-left: 32px;
    min-height: 16px;
}

.validation-feedback.error {
    color: var(--danger-color);
}

.validation-feedback.success {
    color: var(--success-color);
}

/* Form Loading States */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.loading {
    position: relative;
    color: transparent;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Input validation states */
.input-group input:valid {
    border-color: var(--success-color);
}

.input-group input:invalid:not(:focus):not(:placeholder-shown) {
    border-color: var(--danger-color);
}

.input-group input:invalid:not(:focus):not(:placeholder-shown) + .validation-feedback {
    display: block;
}

/* Dark Mode Styles */
body.dark-mode {
    --background-white: #1a202c;
    --background-light: #2d3748;
    --text-color: #e2e8f0;
    --text-light: #a0aec0;
    --border-color: #4a5568;
}

body.dark-mode .app-container {
    background: #1a202c;
}

body.dark-mode .input-group input,
body.dark-mode .input-group select,
body.dark-mode .input-group textarea {
    background: #2d3748;
    color: #e2e8f0;
    border-color: #4a5568;
}

body.dark-mode .input-group input::placeholder {
    color: #a0aec0;
}

body.dark-mode .habit-item {
    background: #2d3748;
    border-color: #4a5568;
}

body.dark-mode .btn-add-habit {
    background: #2d3748;
    border-color: #4a5568;
    color: #a0aec0;
}

body.dark-mode .btn-add-habit:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Legal/Content Pages */
.content-container {
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    padding-right: 4px;
}

.legal-content {
    background: var(--background-white);
    padding: 20px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.legal-content h3 {
    color: var(--primary-color);
    margin-bottom: 16px;
    font-size: 1.4rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 8px;
}

.legal-content h4 {
    color: var(--text-color);
    margin: 20px 0 8px 0;
    font-size: 1.1rem;
}

.legal-content p {
    margin-bottom: 12px;
    line-height: 1.5;
    color: var(--text-color);
}

.legal-content ul {
    margin: 12px 0;
    padding-left: 20px;
}

.legal-content li {
    margin-bottom: 6px;
    line-height: 1.4;
}

.legal-content strong {
    color: var(--text-color);
}

.legal-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-light);
}

/* Scrollbar styling for content containers */
.content-container::-webkit-scrollbar {
    width: 4px;
}

.content-container::-webkit-scrollbar-track {
    background: var(--background-light);
    border-radius: 2px;
}

.content-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.content-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

.material-icons {
    font-size: 24px;
    vertical-align: middle;
}
.material-icons {
    vertical-align: middle;
}
/* Mobile adjustments for legal pages */
@media (max-width: 480px) {
    .legal-content {
        padding: 16px;
    }
    
    .legal-content h3 {
        font-size: 1.3rem;
    }
    
    .legal-content h4 {
        font-size: 1rem;
    }
    
    .content-container {
        max-height: calc(100vh - 120px);
    }
}

/* Animations */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .app-container {
        box-shadow: none;
    }
    
    .screen {
        padding: 12px 12px 60px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 1.2rem;
    }
    
    .stat-card {
        padding: 14px 12px;
    }
    
    .stat-value {
        font-size: 1.4rem;
    }
    
    .bottom-nav {
        padding: 4px 6px;
        height: 52px;
    }
    
    .nav-item {
        padding: 3px 1px;
        min-height: 40px;
        gap: 1px;
    }
    
    .nav-icon {
        font-size: 1.2rem;
    }
    
    .nav-text {
        font-size: 0.6rem;
    }
    
    .nav-badge {
        top: 2px;
        right: 6px;
        min-width: 12px;
        height: 12px;
        font-size: 0.55rem;
    }
    
    .header {
        margin-bottom: 1.2rem;
    }
    
    .header h2 {
        font-size: 1.3rem;
    }
    
    .input-row {
        grid-template-columns: 1fr;
    }
}