.profile-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.profile-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    text-align: center;
}

.profile-photo {
    position: relative;
    display: inline-block;
    margin-bottom: 2rem;
    border-radius: 50%;
    overflow: hidden;
}

.profile-photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 2;
    border-radius: 50%;
}

.profile-photo:hover .profile-photo-overlay,
.profile-photo.touch-active .profile-photo-overlay {
    opacity: 1;
    pointer-events: all;
}

.photo-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 0.75rem;
    text-align: center;
    color: white;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.7);
    z-index: 3;
}

.reset-photo {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    z-index: 3;
}

.reset-photo:hover {
    background: rgba(196, 0, 0, 0.9);
}

.profile-img {
    display: block;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    z-index: 1;
    border: 5px solid var(--primary-red);
}

.profile-info h2 {
    color: var(--primary-dark);
    margin-bottom: 1.5rem;
    font-family: 'Times New Roman', serif;
}

.profile-table {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    border-collapse: collapse;
}

.profile-table th,
.profile-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.profile-table th {
    font-weight: 600;
    color: var(--primary-red);
    width: calc(40% - 15px); /* Reduce left column width by 15px */
}

.profile-table td {
    color: var(--primary-dark);
    width: calc(60% + 15px); /* Increase right column width by 15px */
}

.profile-table tr:last-child th,
.profile-table tr:last-child td {
    border-bottom: none;
}

.profile-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    background-color: #f8f9fa;
}

.profile-input:focus {
    outline: none;
    border-color: var(--primary-red);
}

.profile-input:read-only {
    cursor: default;
    border-color: transparent;
    background-color: transparent;
}

.profile-input:not(:read-only) {
    background-color: white;
    border-color: #ddd;
}

.form-actions {
    margin-top: 2rem;
    text-align: center;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.save-btn, .cancel-btn {
    padding: 0.75rem 2rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    border: none;
}

.save-btn {
    background: var(--primary-red);
    color: white;
}

.save-btn:hover {
    background: var(--primary-dark);
}

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

.cancel-btn:hover {
    background: #5a6268;
}

.hidden-input {
    display: none;
}

.edit-btn {
    display: inline-block;
    background: var(--primary-red);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.edit-btn:hover {
    background: var(--primary-dark);
}

.edit-toggle-btn {
    background: var(--primary-red);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

.edit-toggle-btn:hover {
    background: var(--primary-dark);
}

.edit-toggle-btn.editing {
    background: #6c757d;
}

.edit-toggle-btn.editing:hover {
    background: #5a6268;
}

.photo-form {
    margin-top: 1rem;
}

.button-container {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    width: 100%;
}

.password-btn {
    background: #17a2b8;
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    border: none;
}

.password-btn:hover {
    background: #138496;
}

.modal-content {
    border-radius: 8px;
}

.modal-header {
    background: var(--primary-red);
    color: white;
    border-radius: 8px 8px 0 0;
}

.modal-header .close {
    color: white;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    font-weight: 600;
    color: var(--primary-dark);
}

.text-danger {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
}

.major-display-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.major-display-container.no-majors {
    justify-content: center;
}

.majors-display {
    flex: 1;
    text-align: left;
    margin: 0;
    padding: 0.5rem 0;
    white-space: pre-wrap;
    line-height: 0.5; /* Reduce line height further */
}

.majors-display span {
    display: block;
    margin-bottom: -4px; /* Add negative margin to pull lines closer */
}

/* Style the line breaks */
.majors-display span:after {
    content: "\A"; /* Insert line break */
    white-space: pre;
}

.majors-display span:last-child:after {
    content: none; /* Remove line break after last item */
}

.add-major-btn {
    background: transparent;
    border: 2px dashed var(--primary-red);
    color: var(--primary-red);
    padding: 0.75rem 1.5rem; /* Larger default padding */
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem; /* Larger default font size */
    width: 100%; /* Full width by default */
    white-space: nowrap;
    transition: all 0.3s ease;
}

/* Only apply smaller styles when majors are present */
.major-display-container:not(.no-majors) .add-major-btn {
    width: 80px;  /* Fixed narrow width */
    padding: 0.15rem 0.25rem;  /* Minimal padding */
    font-size: 0.75rem;
    min-width: 80px;  /* Ensure minimum width */
    margin-left: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
}

/* Show just the plus icon when majors exist */
.major-display-container:not(.no-majors) .add-major-btn span {
    display: none;
}

/* Keep icon size proportional */
.add-major-btn i {
    font-size: 0.75em; /* Match new font size */
    margin-right: 3px; /* Reduced margin */
}

.add-major-btn:hover {
    background: var(--primary-red);
    color: white;
}

.add-major-btn i {
    font-size: 0.9em;
    margin-right: 4px;
    transition: transform 0.2s ease;
}

.add-major-btn:hover i {
    transform: rotate(90deg);
}

.major-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.major-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
    cursor: pointer;
}

.major-option label {
    cursor: pointer;
    flex: 1;
    margin: 0;
    padding: 0.25rem 0;
}

.major-checkbox {
    cursor: pointer;
}

.major-limit-text {
    color: var(--primary-dark);
    margin-bottom: 1rem;
    font-style: italic;
}

/* Add mobile styles */
@media (max-width: 768px) {
    .major-display-container {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .major-display-container:not(.no-majors) .add-major-btn {
        width: 100%;
        margin-left: 0;
        margin-top: 0.5rem;
        min-width: auto;
        padding: 0.5rem;
        text-align: center;
    }

    .majors-display {
        text-align: center;
    }
}