* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

}

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

/* Header */
header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 2rem;
    font-weight: bold;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #667eea;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}
.btn-secondary2 {
    background: transparent;
    color: #FFFF;
    border: 2px solid #667eea;
}
.btn-secondary:hover {
    background: #667eea;
    color: white;
}
.btn-secondary2:hover {
    background: #667eea;
    color: white;
}
/* Hero Section */
.hero {
    padding: 120px 0 80px;
    text-align: center;
    color: white;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><polygon fill="rgba(255,255,255,0.1)" points="0,1000 1000,0 1000,1000"/></svg>');
    background-size: cover;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.search-bar {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 50px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.1rem;
    padding: 0.5rem;
}

.search-bar input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-bar button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-bar button:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Stats Section */
.stats {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    margin: 2rem auto;
    max-width: 800px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: white;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

/* Main Content */
.main-content {
    background: white;
    padding: 4rem 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #333;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    margin: 1rem auto;
    border-radius: 2px;
}

/* Cards Grid */
.programs-grid,
.universities-grid {
    display: grid;
    gap: 2rem;
    margin-bottom: 4rem;
}

.programs-grid {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

.universities-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* Cards */
.program-card,
.university-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.program-card {
    overflow: hidden;
}

.program-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.university-card {
    padding: 2rem;
    text-align: center;
}

.university-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.program-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.program-content {
    padding: 1.5rem;
}

.program-title,
.university-name {
    font-weight: bold;
    color: #333;
}

.program-title {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.program-university {
    color: #667eea;
    font-weight: 500;
    margin-bottom: 1rem;
}

.program-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.program-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: #666;
}

.rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #ffa500;
}

.applications-count {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
}

.university-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1rem;
}

.university-name {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.university-country {
    color: #666;
    margin-bottom: 1rem;
}

.university-stats {
    display: flex;
    justify-content: space-around;
    margin-top: 1rem;
}

.university-stat-number {
    font-weight: bold;
    color: #667eea;
}

.university-stat-label {
    font-size: 0.8rem;
    color: #666;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}


/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .search-bar {
        flex-direction: column;
        gap: 1rem;
    }

    .programs-grid,
    .universities-grid {
        grid-template-columns: 1fr;
    }
}
/* обёртка основной секции — чтобы фон плавно переходил */
.section-white {
    background: #fff;
    padding: 60px 0;
    margin-top: -80px; /* поднимаем карточку над градиентом */
}

/* сам блок профиля */
.profile-card {
    max-width: 760px;
    margin: 0 auto;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin-top:6%;
}
.profile-card .photo {
    display: block;
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 50%;
    margin: 0 auto 20px;
}
.profile-card h2 {
    text-align: center;
    margin-bottom: 25px;
    font-size: 24px;
    font-weight: 600;
}
.profile-card dl {
    display: grid;
    grid-template-columns: max-content 1fr;
    row-gap: 12px;
    column-gap: 20px;
}
.profile-card dt { font-weight: 600; color: #555; }
.profile-card dd { margin: 0; color: #333; }
.profile-card h3 {
    margin-top: 30px;
    margin-bottom: 12px;
    font-size: 20px;
}
.profile-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.profile-card ul li {
    margin-bottom: 8px;
}
.profile-card .btn-edit {
    display: inline-block;
    margin: 30px auto 0;
    padding: 10px 25px;
    background: #ffd166;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
}
/* ----------------------------------------
   Общие контейнеры
   ---------------------------------------- */
.section-white {
    background: #fff;
    padding: 60px 20px;
}
.container-card {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px;
    border-radius: 8px;
    background: #fafafa;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* ----------------------------------------
   Просмотр профиля (profile.php)
   ---------------------------------------- */
.profile-view .photo {
    display: block;
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    margin: 0 auto 20px;
}
.profile-view h2 {
    text-align: center;
    font-size: 26px;
    margin-bottom: 15px;
    color: #333;
}
.profile-view dl {
    display: grid;
    grid-template-columns: 140px 1fr;
    row-gap: 12px;
    column-gap: 20px;
    margin-bottom: 25px;
}
.profile-view dt {
    font-weight: 600;
    color: #555;
}
.profile-view dd {
    margin: 0;
    color: #333;
}
.profile-view h3 {
    font-size: 20px;
    margin: 25px 0 12px;
    color: #444;
}
.profile-view .achievements-list {
    list-style: none;
    padding: 0;
}
.profile-view .achievements-list li {
    margin-bottom: 8px;
}
.profile-view .achievements-list li a {
    color: #2a6fdb;
    text-decoration: none;
}
.profile-view .achievements-list li a:hover {
    text-decoration: underline;
}
.profile-view .btn-edit {
    display: block;
    width: max-content;
    margin: 30px auto 0;
    padding: 10px 25px;
    background: #2a6fdb;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
}
.profile-view .btn-edit:hover {
    background: #235bb5;
}
/* Кнопка сохранения */
.btn-save {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #667eea;
    color: white;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-save:hover {
    background: #5a67d8;
}

/* ----------------------------------------
   Редактирование профиля (edit_profile.php)
   ---------------------------------------- */
.profile-edit .form-group {
    margin-bottom: 20px;
}
.profile-edit label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #444;
}
.profile-edit input[type="text"],
.profile-edit input[type="number"],
.profile-edit select,
.profile-edit textarea,
.profile-edit input[type="file"] {
    width: 100%;
    padding: 8px 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    box-sizing: border-box;
}
.profile-edit textarea {
    resize: vertical;
}
.profile-edit .photo-preview {
    display: block;
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 10px;
}
.profile-edit .achievements-list {
    list-style: none;
    padding: 0;
    margin-top: 8px;
}
.profile-edit .achievements-list li {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}
.profile-edit .achievements-list li a.file-link {
    color: #2a6fdb;
    text-decoration: none;
    flex-grow: 1;
}
.profile-edit .achievements-list li a.file-link:hover {
    text-decoration: underline;
}
.profile-edit .achievements-list li a.delete-btn {
    margin-left: 12px;
    font-size: 0.9em;
    color: #e63946;
    text-decoration: none;
}
.profile-edit .achievements-list li a.delete-btn:hover {
    text-decoration: underline;
}
.profile-edit button[type="submit"] {
    padding: 10px 25px;
    background: #2a6fdb;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 15px;
}
.profile-edit button[type="submit"]:hover {
    background: #235bb5;
}
.profile-edit .back-btn {
    display: inline-block;
    margin-top: 15px;
    color: #555;
    text-decoration: none;
}
.profile-edit .back-btn:hover {
    text-decoration: underline;
}
