/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body main {
    flex: 1;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-weight: 600;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Header & Navigation */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-logo a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.navbar-logo a:hover {
    transform: scale(1.05);
    text-decoration: none;
}

.logo-icon {
    font-size: 2rem;
}

.logo-text {
    display: none;
}

@media (min-width: 768px) {
    .logo-text {
        display: inline;
    }
}

.nav-list {
    list-style: none;
    display: flex;
    gap: 0;
    align-items: center;
    flex-wrap: wrap;
}

.nav-link {
    color: white;
    padding: 0.5rem 1rem;
    display: inline-block;
    transition: background-color 0.3s ease;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
    text-decoration: none;
}

.nav-highlight {
    background-color: #ff6b6b;
    border-radius: 4px;
    font-weight: bold;
}

.nav-highlight:hover {
    background-color: #ff5252;
}

.nav-logout {
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    margin-left: 0.5rem;
    padding-left: 1rem;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    border-left: 4px solid;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 768px) {
    .form-row {
        grid-template-columns: 1fr 1fr;
    }
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
textarea,
select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea {
    resize: vertical;
}

select[multiple] {
    height: auto;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    margin: 0.5rem 0;
}

.btn-primary {
    background-color: #667eea;
    color: white;
}

.btn-primary:hover {
    background-color: #5568d3;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
    text-decoration: none;
}

.btn-block {
    width: 100%;
}

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

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

/* Auth */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 200px);
    padding: 1rem;
}

.auth-box {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.auth-box h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #333;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.auth-footer p {
    margin: 0;
}

.auth-footer a {
    font-weight: bold;
}

.register-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .auth-box {
        max-width: 500px;
    }
    
    .register-options {
        grid-template-columns: 1fr 1fr;
    }
}

.option-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.option-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.option-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.option-card h3 {
    margin-bottom: 1rem;
}

.option-card p {
    color: #666;
    margin-bottom: 1.5rem;
}

/* Profiles */
.profile-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.profile-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.profile-header h2 {
    margin: 0;
}

.profile-content {
    padding: 2rem;
}

.profile-info {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .profile-info {
        grid-template-columns: 1fr 1fr;
    }
}

.info-group label {
    font-weight: bold;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.info-group p {
    margin: 0;
    color: #555;
    padding: 0.5rem 0;
}

.profile-skills h3 {
    margin-bottom: 1rem;
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-badge {
    background-color: #667eea;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    display: inline-block;
}

.empty-message {
    color: #999;
    font-style: italic;
}

.profile-edit-container {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.form-actions .btn {
    flex: 1;
}

/* Projects */
.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.project-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.project-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
}

.project-header h3 {
    margin: 0;
}

.project-body {
    padding: 1.5rem;
}

.project-category {
    display: inline-block;
    background-color: #f0f0f0;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 1rem;
}

.project-description {
    color: #555;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.project-company {
    font-weight: bold;
    color: #667eea;
    margin-bottom: 1rem;
}

.project-footer {
    padding: 1rem 1.5rem;
    background-color: #f8f9fa;
    border-top: 1px solid #eee;
}

.project-footer .btn {
    width: 100%;
}

/* Search & Filters */
.search-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.search-container h2 {
    margin-bottom: 1rem;
    color: #333;
}

.search-form .btn {
    align-self: end;
    padding: 0.65rem 1rem;
}

.projects-grid {
    margin-top: 1rem;
}

.tag-badge {
    display: inline-block;
    background: linear-gradient(135deg, #eef2ff 0%, #e6f0ff 100%);
    color: #2b2f6b;
    padding: 0.3rem 0.6rem;
    border-radius: 16px;
    font-size: 0.8rem;
    margin-right: 0.5rem;
    margin-bottom: 0.4rem;
    border: 1px solid rgba(102, 126, 234, 0.12);
}

.empty-message {
    color: #555;
    font-style: normal;
    padding: 1rem;
    background: #fff7f0;
    border-radius: 6px;
    border-left: 4px solid #ffc107;
}

.form-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
}

/* Results header */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Strong visual tweaks to ensure changes are visible */
.results-header {
    background: linear-gradient(90deg, #f0f4ff 0%, #ffffff 100%);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(102,126,234,0.12);
}

.results-title {
    margin: 0;
    font-size: 1.15rem;
    color: #333;
}

.results-count {
    display: inline-block;
    margin-left: 0.75rem;
    background: #f1f5ff;
    color: #2b2f6b;
    border: 1px solid rgba(102,126,234,0.12);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
}

.project-card {
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    border: 1px solid rgba(0,0,0,0.04);
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.project-header {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    background: linear-gradient(90deg, rgba(255,255,255,0.4), rgba(255,255,255,0.2));
}

.project-thumb img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #eee;
}

.project-title-wrap h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.05rem;
}

.project-meta {
    display: flex;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #666;
}

.project-meta .project-category {
    background: #eef2ff;
    color: #2b2f6b;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
}

.project-meta .project-company {
    color: #667eea;
    font-weight: 600;
}

.project-date {
    color: #999;
}

/* Companies grid and cards */
.companies-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 1rem;
}

@media (min-width: 768px) {
    .companies-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .companies-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.company-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.company-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.company-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
}

.company-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.company-body {
    padding: 1.5rem;
    flex-grow: 1;
}

.company-body p {
    color: #555;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.company-website {
    margin-top: 0.5rem;
}

.company-website a {
    color: #667eea;
    text-decoration: none;
    word-break: break-all;
}

.company-website a:hover {
    text-decoration: underline;
}

.company-footer {
    padding: 1rem 1.5rem;
    background-color: #f8f9fa;
    border-top: 1px solid #eee;
}

.company-footer .btn {
    width: 100%;
}

.search-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 768px) {
    .search-form {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .search-form {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-top: 4rem;
    padding: 3rem 1rem 1rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .footer-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .footer-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

.footer-section h4 {
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: #fff;
    text-decoration: underline;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 2rem;
}

/* Utilities */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.project-list {
    list-style: none;
    padding: 0;
}

.project-list li {
    background: #ffffff;
    margin: 10px 0;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}

.footer {
    text-align: center;
    padding: 20px 0;
    background: #35424a;
    color: #ffffff;
    position: relative;
    bottom: 0;
    width: 100%;
}

/* Profile Styles */
.profile-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 2rem;
}

.profile-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.profile-header h2 {
    margin: 0;
    font-size: 1.75rem;
}

.profile-content {
    padding: 2rem;
}

.profile-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.info-group {
    display: flex;
    flex-direction: column;
}

.info-group label {
    font-weight: 600;
    color: #667eea;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.info-group p {
    color: #555;
    line-height: 1.6;
    word-break: break-word;
}

.info-group a {
    color: #007bff;
    word-break: break-word;
}

.info-group a:hover {
    color: #0056b3;
}

.profile-header + .mt-4 {
    margin-top: 2rem;
}

.profile-header + .mt-4 h3 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.project-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
    border-color: #667eea;
}

/* Dev debug: visible outline to verify CSS load */
.dev-style-check {
    outline: 4px dashed rgba(255,99,71,0.6);
}

.project-header {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 1rem;
    border-bottom: 2px solid #667eea;
}

.project-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.1rem;
}

.project-body {
    padding: 1rem;
    flex-grow: 1;
}

.project-category {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.project-description {
    color: #666;
    font-size: 0.95rem;
    margin: 0.75rem 0;
    line-height: 1.5;
}

.project-body p {
    margin: 0.5rem 0;
    color: #555;
}

.project-body p strong {
    color: #333;
}

.project-footer {
    padding: 1rem;
    display: flex;
    gap: 0.5rem;
    border-top: 1px solid #f0f0f0;
    flex-wrap: wrap;
}

.project-footer .btn {
    flex: 1;
    min-width: 100px;
}

/* Skills Section */
.profile-skills {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #f0f0f0;
}

.profile-skills h3 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.add-skill-section {
    margin-bottom: 1.5rem;
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-start;
}

.skill-badge-container {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.skill-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
    transition: all 0.3s ease;
}

.skill-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.skill-remove {
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    min-width: 24px;
    padding: 0;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
}

.skill-remove:hover {
    background: #ff5252;
    transform: scale(1.1);
}

.empty-message {
    color: #999;
    font-style: italic;
    padding: 1rem;
    background: #f9f9f9;
    border-radius: 4px;
    border-left: 3px solid #667eea;
    margin: 0;
}

.empty-message a {
    color: #667eea;
    font-weight: 600;
    text-decoration: none;
}

.empty-message a:hover {
    text-decoration: underline;
}

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

    nav {
        display: flex;
        flex-direction: column;
    }

    nav a {
        padding: 10px;
        text-align: center;
    }

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

    .profile-header h2 {
        font-size: 1.5rem;
    }

    .profile-info {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .project-footer {
        flex-direction: column;
    }

    .project-footer .btn {
        width: 100%;
    }

    .skills-list {
        justify-content: flex-start;
    }

    .skill-badge {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Profile Forms */
.profile-form {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.5rem;
}

.form-group label {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-control {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-control:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    color: #999;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.form-actions .btn {
    flex: 1;
    min-width: 120px;
    padding: 0.75rem 1.5rem;
    text-align: center;
}

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

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }

    .profile-form {
        padding: 1rem;
    }
}