/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: #f8fafc;
    color: #334155;
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Sidebar Styles */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: #f1f5f9;
    padding: 25px 20px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #334155;
}

.logo i {
    font-size: 28px;
    color: #60a5fa;
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(90deg, #60a5fa, #3b82f6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.nav-menu {
    list-style: none;
    flex-grow: 1;
}

.nav-menu li {
    padding: 14px 16px;
    margin-bottom: 8px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-menu li:hover {
    background-color: #334155;
    transform: translateX(5px);
}

.nav-menu li.active {
    background-color: #3b82f6;
    color: white;
}

.nav-menu li i {
    width: 20px;
    text-align: center;
}

.add-project {
    margin: 25px 0;
}

#addProjectBtn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(90deg, #10b981, #059669);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

#addProjectBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4);
}

.footer-info {
    font-size: 14px;
    color: #94a3b8;
    border-top: 1px solid #334155;
    padding-top: 20px;
}

.footer-info p {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

#totalProjects {
    color: #60a5fa;
    font-weight: 600;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 30px;
    max-width: calc(100% - 260px);
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 20px;
}

.header-left h2 {
    font-size: 28px;
    color: #1e293b;
    margin-bottom: 5px;
}

.header-left p {
    color: #64748b;
}

.header-right {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    width: 300px;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

#searchInput {
    width: 100%;
    padding: 14px 20px 14px 45px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    background-color: white;
    transition: all 0.3s ease;
}

#searchInput:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.view-controls {
    display: flex;
    gap: 10px;
    background-color: #f1f5f9;
    padding: 6px;
    border-radius: 10px;
}

.view-controls button {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-controls button.active {
    background-color: white;
    color: #3b82f6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Stats Container */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background-color: white;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.stat-info h3 {
    font-size: 32px;
    color: #1e293b;
    margin-bottom: 5px;
}

.stat-info p {
    color: #64748b;
    font-size: 14px;
}

/* Projects Section */
.projects-section {
    background-color: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-header h3 {
    font-size: 22px;
    color: #1e293b;
}

.filter-controls {
    display: flex;
    gap: 15px;
}

.filter-controls select {
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background-color: white;
    color: #334155;
    font-weight: 500;
    cursor: pointer;
    min-width: 160px;
}

.filter-controls select:focus {
    outline: none;
    border-color: #3b82f6;
}

/* Projects Container */
.projects-container {
    transition: all 0.3s ease;
}

/* Grid View */
.projects-container.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
}

/* List View */
.projects-container.list-view {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Project Cards */
.project-card {
    background-color: #f8fafc;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
}

.grid-view .project-card {
    height: 100%;
}

.list-view .project-card {
    display: flex;
    align-items: center;
    padding-right: 20px;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e1;
}

.project-header {
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.list-view .project-header {
    border-bottom: none;
    min-width: 250px;
    border-right: 1px solid #e2e8f0;
}

.project-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 5px;
}

.project-url {
    color: #3b82f6;
    font-size: 14px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
}

.project-url:hover {
    text-decoration: underline;
}

.project-type {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.project-type.web { background-color: #dbeafe; color: #1d4ed8; }
.project-type.webapp { background-color: #f0f9ff; color: #0369a1; }
.project-type.mobile { background-color: #fef3c7; color: #92400e; }
.project-type.ecommerce { background-color: #fce7f3; color: #be185d; }
.project-type.dashboard { background-color: #f3e8ff; color: #7c3aed; }
.project-type.other { background-color: #dcfce7; color: #166534; }

.project-body {
    padding: 20px;
}

.list-view .project-body {
    flex-grow: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.project-description {
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.list-view .project-description {
    margin-bottom: 0;
    flex-grow: 1;
    margin-right: 30px;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tech-tag {
    padding: 6px 12px;
    background-color: #e2e8f0;
    color: #475569;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.project-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #f1f5f9;
    border-top: 1px solid #e2e8f0;
}

.list-view .project-footer {
    border-top: none;
    border-left: 1px solid #e2e8f0;
    flex-direction: column;
    justify-content: center;
    min-width: 150px;
}

.project-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-active { background-color: #10b981; }
.status-inactive { background-color: #ef4444; }
.status-maintenance { background-color: #f59e0b; }
.status-development { background-color: #8b5cf6; }

.project-date {
    color: #64748b;
    font-size: 14px;
}

.project-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-view {
    background-color: #3b82f6;
    color: white;
}

.btn-edit {
    background-color: #f1f5f9;
    color: #475569;
}

.btn-delete {
    background-color: #fef2f2;
    color: #dc2626;
}

.action-btn:hover {
    transform: translateY(-2px);
}

.btn-view:hover { background-color: #2563eb; }
.btn-edit:hover { background-color: #e2e8f0; }
.btn-delete:hover { background-color: #fee2e2; }

/* Loading Animation */
.loading {
    text-align: center;
    padding: 60px;
    color: #64748b;
}

.loading i {
    font-size: 40px;
    margin-bottom: 15px;
    color: #3b82f6;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: white;
    border-radius: 20px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 25px 30px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 22px;
    color: #1e293b;
}

.close-modal {
    background: none;
    border: none;
    font-size: 28px;
    color: #64748b;
    cursor: pointer;
    line-height: 1;
}

.close-modal:hover {
    color: #1e293b;
}

form {
    padding: 30px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #334155;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row .form-group {
    flex: 1;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-group input {
    width: auto;
    transform: scale(1.2);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
}

.btn-primary, .btn-secondary {
    padding: 14px 28px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    color: white;
}

.btn-secondary {
    background-color: #f1f5f9;
    color: #475569;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.4);
}

.btn-secondary:hover {
    background-color: #e2e8f0;
}

/* Project Details Modal */
.project-details {
    padding: 30px;
}

.details-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
}

.details-title h3 {
    font-size: 24px;
    color: #1e293b;
    margin-bottom: 5px;
}

.details-url a {
    color: #3b82f6;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.details-url a:hover {
    text-decoration: underline;
}

.details-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.meta-label {
    font-size: 14px;
    color: #64748b;
}

.meta-value {
    font-weight: 500;
    color: #1e293b;
}

.details-description h4,
.details-tech h4 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #1e293b;
}

.details-description p {
    color: #475569;
    line-height: 1.7;
    margin-bottom: 30px;
}

.tech-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tech-list span {
    padding: 10px 18px;
    background-color: #e2e8f0;
    color: #475569;
    border-radius: 10px;
    font-weight: 500;
}

/* Featured Project */
.project-card.featured {
    border: 2px solid #f59e0b;
    position: relative;
}

.featured-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: #f59e0b;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Responsive Styles */
@media (max-width: 1200px) {
    .sidebar {
        width: 80px;
        padding: 25px 15px;
    }
    
    .logo h1, 
    .nav-menu li span,
    .footer-info p span:not(#totalProjects),
    #addProjectBtn span {
        display: none;
    }
    
    .logo {
        justify-content: center;
        padding-bottom: 15px;
    }
    
    .logo i {
        font-size: 32px;
    }
    
    .nav-menu li {
        justify-content: center;
        padding: 15px;
    }
    
    .nav-menu li i {
        font-size: 20px;
    }
    
    #addProjectBtn {
        padding: 15px;
    }
    
    .main-content {
        margin-left: 80px;
        max-width: calc(100% - 80px);
        padding: 20px;
    }
}

@media (max-width: 992px) {
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .projects-container.grid-view {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    
    .header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-right {
        width: 100%;
    }
    
    .search-box {
        flex-grow: 1;
        width: auto;
    }

    .filter-controls select {
        min-width: 0;
    }

    .list-view .project-header {
        min-width: 200px;
    }

    .list-view .project-footer {
        min-width: 120px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        padding: 15px;
    }
    
    .logo {
        width: 100%;
        margin-bottom: 15px;
        justify-content: center;
    }
    
    .nav-menu {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        order: 3;
        margin-top: 15px;
    }
    
    .nav-menu li {
        margin-bottom: 0;
    }
    
    .add-project {
        order: 2;
        margin: 0;
    }
    
    .footer-info {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
        max-width: 100%;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .projects-container.grid-view {
        grid-template-columns: 1fr;
    }
    
    .list-view .project-card {
        flex-direction: column;
        padding-right: 0;
    }
    
    .list-view .project-header,
    .list-view .project-footer {
        width: 100%;
        border-right: none;
        border-left: none;
    }
    
    .list-view .project-body {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }
    
    .list-view .project-description {
        margin-right: 0;
        margin-bottom: 20px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filter-controls {
        width: 100%;
    }
    
    .filter-controls select {
        flex-grow: 1;
    }
    
    .modal-content {
        margin: 10px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
}

@media (max-width: 480px) {
    .header-right {
        flex-direction: column;
        width: 100%;
    }
    
    .search-box {
        width: 100%;
    }
    
    .view-controls {
        align-self: flex-start;
    }
    
    .project-footer {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
    }
}