/* Global Styles */
:root {
    --primary-color: #4CAF50;
    --primary-dark: #388E3C;
    --secondary-color: #2196F3;
    --danger-color: #F44336;
    --warning-color: #FFC107;
    --success-color: #4CAF50;
    --info-color: #00BCD4;
    --dark-color: #333;
    --light-color: #f9f9f9;
    --gray-color: #ddd;
    --text-color: #333;
    --text-light: #777;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-color);
    background-color: #f5f5f5;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-primary {
    background-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-small {
    padding: 8px 15px;
    font-size: 0.9rem;
}

.btn-danger {
    background-color: var(--danger-color);
}

.btn-danger:hover {
    background-color: #D32F2F;
}

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: var(--border-radius);
    font-weight: 500;
}

.alert.error {
    background-color: #FFEBEE;
    color: var(--danger-color);
    border-left: 4px solid var(--danger-color);
}

.alert.success {
    background-color: #E8F5E9;
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge.success {
    background-color: #E8F5E9;
    color: var(--success-color);
}

.badge.warning {
    background-color: #FFF8E1;
    color: #FFA000;
}

.badge.danger {
    background-color: #FFEBEE;
    color: var(--danger-color);
}

.badge.info {
    background-color: #E1F5FE;
    color: var(--info-color);
}

/* Header Styles */
header {
    background-color: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}

nav ul {
    display: flex;
    align-items: center;
    gap: 20px;
}

nav ul li a {
    font-weight: 500;
    transition: color 0.3s ease;
}

nav ul li a:hover {
    color: var(--primary-color);
}

nav ul li a.active {
    color: var(--primary-color);
    font-weight: 600;
}

/* Hero Section */
.hero {
    padding: 80px 0;
    background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
}

.hero .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hero-content {
    flex: 1;
    max-width: 600px;
}

.hero-content h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    line-height: 1.3;
}

.hero-content p {
    font-size: 1.1rem;
    margin-bottom: 30px;
    color: var(--text-light);
}

.hero-image {
    flex: 1;
    text-align: center;
}

.hero-image img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

/* Features Section */
.features {
    padding: 80px 0;
}

.features h2 {
    text-align: center;
    margin-bottom: 50px;
    font-size: 2rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-card {
    background-color: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-10px);
}

.feature-card .icon {
    font-size: 3rem;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.feature-card h3 {
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.feature-card p {
    color: var(--text-light);
}

/* How It Works Section */
.how-it-works {
    padding: 80px 0;
    background-color: #f9f9f9;
}

.how-it-works h2 {
    text-align: center;
    margin-bottom: 50px;
    font-size: 2rem;
}

.steps {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.step {
    flex: 1;
    min-width: 200px;
    text-align: center;
    padding: 30px 20px;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    position: relative;
}

.step-number {
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 20px;
}

.step h3 {
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.step p {
    color: var(--text-light);
}

/* Footer */
footer {
    background-color: var(--dark-color);
    color: white;
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: white;
}

.footer-links h4 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: white;
}

.footer-links ul li {
    margin-bottom: 10px;
}

.footer-links ul li a {
    color: #bbb;
    transition: color 0.3s ease;
}

.footer-links ul li a:hover {
    color: white;
}

.footer-cta h4 {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #bbb;
    font-size: 0.9rem;
}

/* Auth Forms */
.auth-form {
    padding: 60px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 150px);
}

.form-card {
    background-color: white;
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 500px;
}

.form-card h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.8rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--gray-color);
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    outline: none;
}

.auth-link {
    text-align: center;
    margin-top: 20px;
    color: var(--text-light);
}

.auth-link a {
    color: var(--primary-color);
    font-weight: 500;
}

/* Dashboard Styles */
.dashboard {
    padding: 40px 0;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
}

.dashboard-sidebar {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 30px;
    height: fit-content;
}

.user-profile {
    text-align: center;
    margin-bottom: 30px;
}

.avatar {
    width: 80px;
    height: 80px;
    background-color: #E8F5E9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    color: var(--primary-color);
    font-size: 2rem;
}

.user-profile h3 {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.user-profile p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.dashboard-nav ul {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dashboard-nav ul li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
}

.dashboard-nav ul li a:hover,
.dashboard-nav ul li a.active {
    background-color: #E8F5E9;
    color: var(--primary-color);
}

.dashboard-nav ul li a i {
    width: 20px;
    text-align: center;
}

.dashboard-content {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 30px;
}

.dashboard-header h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.dashboard-header p {
    color: var(--text-light);
    margin-bottom: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: var(--border-radius);
    text-align: center;
}

.stat-card h3 {
    font-size: 1rem;
    margin-bottom: 15px;
    color: var(--text-light);
}

.stat-card .amount {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.stat-card.balance {
    border-left: 4px solid var(--primary-color);
}

.stat-card.credit-score {
    border-left: 4px solid var(--secondary-color);
}

.stat-card.savings {
    border-left: 4px solid var(--info-color);
}

.score {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.score span {
    font-size: 1rem;
    font-weight: normal;
    color: var(--text-light);
}

.progress-bar {
    height: 8px;
    background-color: #eee;
    border-radius: 4px;
    margin-bottom: 10px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 4px;
}

.dashboard-section {
    margin-bottom: 30px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h3 {
    font-size: 1.3rem;
}

.view-all {
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.9rem;
}

.transactions-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.transaction-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-radius: var(--border-radius);
    background-color: #f9f9f9;
    transition: all 0.3s ease;
}

.transaction-item:hover {
    background-color: #f0f0f0;
}

.transaction-icon {
    width: 40px;
    height: 40px;
    background-color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    color: var(--primary-color);
}

.transaction-icon .success {
    color: var(--success-color);
}

.transaction-icon .danger {
    color: var(--danger-color);
}

.transaction-details {
    flex: 1;
}

.transaction-details h4 {
    font-size: 1rem;
    margin-bottom: 5px;
}

.transaction-details .date {
    font-size: 0.8rem;
    color: var(--text-light);
}

.transaction-amount {
    font-weight: 700;
}

.transaction-amount.success {
    color: var(--success-color);
}

.transaction-amount.danger {
    color: var(--danger-color);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.product-card {
    background-color: #f9f9f9;
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.product-image {
    height: 150px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-details {
    padding: 15px;
}

.product-details h4 {
    font-size: 1rem;
    margin-bottom: 5px;
}

.product-details .description {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 10px;
    display: -webkit-box;
    
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-details .price {
    font-weight: 700;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.product-actions {
    display: flex;
    gap: 10px;
}

.savings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .savings-grid {
        grid-template-columns: 1fr;
    }
}

.savings-form {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: var(--border-radius);
}

.savings-form h3 {
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.savings-stats {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.savings-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.savings-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
}

.savings-item:hover {
    background-color: #f0f0f0;
}

.savings-icon {
    width: 50px;
    height: 50px;
    background-color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.savings-details h4 {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.savings-details .frequency {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 5px;
}

.savings-details .date {
    font-size: 0.8rem;
    color: var(--text-light);
}

.marketplace-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.marketplace-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.search-bar {
    display: flex;
    align-items: center;
    background-color: #f9f9f9;
    border-radius: var(--border-radius);
    overflow: hidden;
    width: 300px;
}

.search-bar input {
    flex: 1;
    padding: 10px 15px;
    border: none;
    background-color: transparent;
}

.search-bar button {
    padding: 10px 15px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
}

.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

@media (max-width: 768px) {
    .product-detail {
        grid-template-columns: 1fr;
    }
}

.product-gallery {
    background-color: #f9f9f9;
    border-radius: var(--border-radius);
    padding: 20px;
}

.main-image {
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.main-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-info h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.product-info .price {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.product-info .stock {
    display: inline-block;
    padding: 5px 10px;
    background-color: #E8F5E9;
    color: var(--primary-color);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.product-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    color: var(--text-light);
    font-size: 0.9rem;
}

.product-meta i {
    margin-right: 5px;
}

.product-description {
    margin-bottom: 30px;
}

.product-description h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.purchase-options {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: var(--border-radius);
    margin-top: 30px;
}

.purchase-options h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.seller-options {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.transaction-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--gray-color);
}

.modal-header h3 {
    font-size: 1.3rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
}

.modal-body {
    padding: 20px;
}

.hint {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 5px;
}

/* Admin Dashboard */
.admin .table-responsive {
    overflow-x: auto;
}

.admin table {
    width: 100%;
    border-collapse: collapse;
}

.admin th, .admin td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--gray-color);
}

.admin th {
    background-color: #f9f9f9;
    font-weight: 600;
}

.admin tr:hover {
    background-color: #f5f5f5;
}

.tab-header {
    display: flex;
    border-bottom: 1px solid var(--gray-color);
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    position: relative;
}

.tab-btn.active {
    color: var(--primary-color);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Credit Score Page */
.credit-score-display {
    display: flex;
    align-items: center;
    gap: 50px;
    margin-bottom: 40px;
}

@media (max-width: 768px) {
    .credit-score-display {
        flex-direction: column;
        gap: 30px;
    }
}

.score-circle {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.score-value {
    font-size: 3rem;
    font-weight: 700;
}

.score-label {
    font-size: 0.9rem;
    color: var(--text-light);
}

.score-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.ring-progress {
    stroke-dasharray: 0, 100;
    transition: stroke-dasharray 1s ease;
}

.score-details h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.score-details p {
    color: var(--text-light);
    margin-bottom: 20px;
}

.score-factors {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.factor {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: var(--border-radius);
}

.factor h4 {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 5px;
}

.factor p {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
}

.credit-tips {
    margin-bottom: 40px;
}

.credit-tips h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.tip-card {
    background-color: white;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.tip-icon {
    width: 50px;
    height: 50px;
    background-color: #E8F5E9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.tip-card h4 {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.tip-card p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.history-chart {
    background-color: white;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    height: 300px;
}

.chart-placeholder {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f9f9f9;
    border-radius: var(--border-radius);
    color: var(--text-light);
}

/* Responsive Styles */
@media (max-width: 992px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-sidebar {
        margin-bottom: 30px;
    }
}

@media (max-width: 768px) {
    header .container {
        flex-direction: column;
    }
    
    nav ul {
        margin-top: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .hero .container {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-content {
        margin-bottom: 30px;
    }
    
    .steps {
        flex-direction: column;
    }
    
    .step {
        margin-bottom: 20px;
    }
    
    .product-detail {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .marketplace-actions {
        flex-direction: column;
        gap: 15px;
    }
    
    .search-bar {
        width: 100%;
    }
}