/* ==========================================================================
   Base Styles & Reset
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: #F4F5F7;
    color: #172B4D;
    line-height: 1.5;
}

/* ==========================================================================
   Header Styles
   ========================================================================== */

.header {
    background: white;
    border-bottom: 1px solid #DFE1E6;
    padding: 16px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo h1 {
    color: #36B37E;
    font-size: 24px;
    font-weight: 600;
}

.student-badge {
    background: linear-gradient(135deg, #36B37E, #00875A);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(54, 179, 126, 0.3);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.welcome-text {
    color: #172B4D;
    font-size: 14px;
    font-weight: 600;
}

.logout-btn {
    background: #F4F5F7;
    color: #42526E;
    border: 1px solid #DFE1E6;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: #EBECF0;
    border-color: #C1C7D0;
}

/* ==========================================================================
   Main Content
   ========================================================================== */

.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

/* ==========================================================================
   Profile Header
   ========================================================================== */

.profile-header {
    background: white;
    border-radius: 8px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.profile-header.attention {
    border-left: 4px solid #DE350B;
    background: linear-gradient(135deg, #FFEBE6 0%, white 30%);
}

.profile-header.normal {
    border-left: 4px solid #36B37E;
}

.profile-main {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 24px;
    align-items: start;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #36B37E, #00875A);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    font-weight: 600;
    flex-shrink: 0;
}

.student-name {
    font-size: 28px;
    font-weight: 700;
    color: #172B4D;
    margin-bottom: 8px;
}

.student-passport {
    font-size: 16px;
    color: #6B778C;
    font-family: 'Monaco', 'Consolas', monospace;
    margin-bottom: 16px;
}

.profile-badges {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 500;
}

.attention-badge {
    background: #DE350B;
    color: white;
}

.normal-badge {
    background: #36B37E;
    color: white;
}

.type-badge {
    background: #0052CC;
    color: white;
}

.profile-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-btn {
    background: #36B37E;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    text-align: center;
    white-space: nowrap;
}

.action-btn:hover {
    background: #00875A;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(54, 179, 126, 0.3);
}

.action-btn.secondary {
    background: #F4F5F7;
    color: #42526E;
    border: 1px solid #DFE1E6;
}

.action-btn.secondary:hover {
    background: #EBECF0;
    border-color: #C1C7D0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.record-id-badge {
    background: #F4F5F7;
    color: #6B778C;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-family: 'Monaco', 'Consolas', monospace;
    text-align: center;
    margin: 24px auto 0;
    display: block;
    width: fit-content;
}

/* ==========================================================================
   Content Grid
   ========================================================================== */

.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.info-section {
    background: white;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #EBECF0;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: #172B4D;
}

.section-icon {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    color: #36B37E;
}

.info-grid {
    display: grid;
    gap: 16px;
}

.info-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #F4F5F7;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 500;
    color: #6B778C;
    font-size: 14px;
}

.info-value {
    color: #172B4D;
    font-size: 14px;
    word-break: break-word;
}

.info-value.empty {
    color: #6B778C;
    font-style: italic;
}

.full-width-section {
    grid-column: 1 / -1;
}

/* ==========================================================================
   Timeline Section
   ========================================================================== */

.timeline-section {
    background: white;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 24px;
}

.timeline-header {
    background: #F8F9FB;
    padding: 24px;
    border-bottom: 1px solid #EBECF0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.timeline-title {
    font-size: 24px;
    font-weight: 700;
    color: #172B4D;
}

.timeline-subtitle {
    color: #6B778C;
    font-size: 14px;
    margin-top: 4px;
}

.timeline-stats {
    text-align: right;
    color: #6B778C;
}

.timeline-list {
    padding: 24px;
    max-height: 600px;
    overflow-y: auto;
}

.timeline-item {
    background: #FAFBFC;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
    border-left: 4px solid #DFE1E6;
    position: relative;
    transition: all 0.2s ease;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-item.attention {
    border-left: 6px solid #FF6B35 !important;
    background: linear-gradient(135deg, #FFF4F1 0%, #FFEBE6 30%, #FAFBFC 70%) !important;
    box-shadow: 0 4px 16px rgba(255, 107, 53, 0.2) !important;
    border: 1px solid #FFCAB0 !important;
    border-left: 6px solid #FF6B35 !important;
}

.timeline-item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 16px;
}

.timeline-item-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.timeline-item-title {
    font-size: 18px;
    font-weight: 600;
    color: #172B4D;
}

.timeline-attention-badge {
    background: #FF6B35 !important;
    color: white !important;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
    animation: attentionPulse 2.5s infinite;
}

@keyframes attentionPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(255, 107, 53, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 4px 16px rgba(255, 107, 53, 0.6);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(255, 107, 53, 0.4);
    }
}

.timeline-item-date {
    color: #6B778C;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.timeline-item-description {
    color: #6B778C;
    margin-bottom: 20px;
    line-height: 1.6;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3 {
    color: #172B4D;
    margin: 16px 0 8px 0;
    font-weight: 600;
}

.markdown-content h1 {
    font-size: 24px;
    border-bottom: 2px solid #EBECF0;
    padding-bottom: 8px;
}

.markdown-content h2 {
    font-size: 20px;
}

.markdown-content h3 {
    font-size: 18px;
}

.markdown-content p {
    margin: 12px 0;
    line-height: 1.6;
}

.markdown-content strong {
    font-weight: 600;
    color: #172B4D;
}

.markdown-content ul {
    margin: 12px 0;
    padding-left: 24px;
}

.markdown-content li {
    margin: 6px 0;
    line-height: 1.5;
}

.timeline-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.timeline-btn {
    background: #36B37E;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.timeline-btn:hover:not(.uploading) {
    background: #00875A;
    transform: translateY(-1px);
}

.timeline-btn.secondary {
    background: white;
    color: #42526E;
    border: 1px solid #DFE1E6;
}

.timeline-btn.secondary:hover {
    background: #F4F5F7;
    border-color: #C1C7D0;
}

.timeline-btn.uploading {
    background: #A5ADBA;
    cursor: not-allowed;
    transform: none;
}

.timeline-btn .upload-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

.timeline-btn.uploading .upload-spinner {
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.payment-btn {
    background: #36B37E;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.payment-btn:hover {
    background: #00875A;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(54, 179, 126, 0.3);
}

.payment-btn .payment-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* ==========================================================================
   Loading & Error States
   ========================================================================== */

.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #F4F5F7;
    border-top: 4px solid #36B37E;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.error-message {
    background: #FFEBE6;
    color: #DE350B;
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 24px;
    text-align: center;
}

.not-found {
    text-align: center;
    padding: 64px 24px;
    color: #6B778C;
}

.not-found h2 {
    font-size: 24px;
    margin-bottom: 16px;
}

.not-found p {
    font-size: 16px;
    margin-bottom: 24px;
}

/* ==========================================================================
   Modal Styles
   ========================================================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background: white;
    border-radius: 8px;
    padding: 32px;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #EBECF0;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #172B4D;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6B778C;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #172B4D;
    background: #F4F5F7;
    border-radius: 4px;
}

/* ==========================================================================
   Contact Support Modal
   ========================================================================== */

.contact-option-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 20px;
    background: white;
    border: 2px solid #EBECF0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    gap: 16px;
}

.contact-option-btn:hover {
    border-color: #36B37E;
    background: #F3F9F6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(54, 179, 126, 0.2);
}

.contact-option-btn.whatsapp:hover {
    border-color: #25D366;
    background: #F0FFF4;
}

.contact-option-btn.telegram:hover {
    border-color: #0088CC;
    background: #F0F8FF;
}

.contact-option-btn.email:hover {
    border-color: #4285F4;
    background: #F8FAFF;
}

.contact-icon {
    font-size: 32px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F4F5F7;
    border-radius: 12px;
    flex-shrink: 0;
}

.contact-option-btn.whatsapp .contact-icon {
    background: #E8F5E8;
}

.contact-option-btn.telegram .contact-icon {
    background: #E3F2FD;
}

.contact-option-btn.email .contact-icon {
    background: #F3F4F6;
}

.contact-info {
    flex: 1;
    min-width: 0;
}

.contact-title {
    font-size: 18px;
    font-weight: 600;
    color: #172B4D;
    margin-bottom: 4px;
}

.contact-description {
    font-size: 14px;
    color: #6B778C;
}

.contact-arrow {
    font-size: 20px;
    color: #6B778C;
    font-weight: bold;
    flex-shrink: 0;
}

.contact-option-btn:hover .contact-arrow {
    color: #36B37E;
    transform: translateX(4px);
}

/* ==========================================================================
   Batch Upload Modal
   ========================================================================== */

.upload-area {
    border: 3px dashed #36B37E;
    border-radius: 8px;
    padding: 32px;
    text-align: center;
    cursor: pointer;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: #00875A;
    background: rgba(54, 179, 126, 0.05);
}

.upload-area.dragover {
    border-color: #00875A;
    background: rgba(54, 179, 126, 0.1);
    border-style: solid;
}

.upload-area.interview-mode {
    border-color: #8B5CF6;
    background: rgba(139, 92, 246, 0.05);
}

.upload-area.interview-mode:hover {
    border-color: #7C3AED;
    background: rgba(139, 92, 246, 0.1);
}

.upload-text {
    color: #172B4D;
    font-size: 18px;
    margin-bottom: 8px;
    font-weight: 500;
}

.upload-subtext {
    color: #6B778C;
    font-size: 14px;
}

.upload-restriction-notice {
    background: #F3E8FF;
    color: #7C3AED;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid #E9D5FF;
    display: none;
}

.upload-restriction-notice.show {
    display: block;
}

.batch-info {
    background: #F8F9FB;
    padding: 16px;
    border-radius: 6px;
    margin: 16px 0;
    border: 1px solid #EBECF0;
}

.batch-info h3 {
    margin: 0 0 8px 0;
    color: #172B4D;
    font-size: 14px;
    font-weight: 600;
}

.batch-info p {
    margin: 4px 0;
    color: #6B778C;
    font-size: 13px;
}

.file-input {
    display: none;
}

.selected-files {
    margin: 20px 0;
    max-height: 300px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #F4F5F7;
    border-radius: 6px;
    margin-bottom: 8px;
    border: 1px solid #EBECF0;
    transition: all 0.2s ease;
}

.file-item.invalid {
    background: #FFEBE6;
    border-color: #FFBDAD;
}

.file-item.uploading {
    background: #FFF4E6;
    border-color: #FFE0B2;
}

.file-item.success {
    background: #E3FCEF;
    border-color: #ABF5D1;
}

.file-item.error {
    background: #FFEBE6;
    border-color: #FFBDAD;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 500;
    color: #172B4D;
    margin-bottom: 4px;
    word-break: break-word;
    font-size: 14px;
}

.file-size {
    font-size: 12px;
    color: #6B778C;
    margin-bottom: 2px;
}

.file-type-error {
    font-size: 12px;
    color: #DE350B;
    font-weight: 500;
    margin-bottom: 2px;
}

.file-compression-info {
    font-size: 11px;
    color: #36B37E;
    font-style: italic;
}

.file-error-msg {
    font-size: 11px;
    color: #DE350B;
    font-style: italic;
}

.file-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    margin-left: 12px;
    white-space: nowrap;
}

.status-ready {
    background: #E3FCEF;
    color: #006644;
}

.status-uploading {
    background: #FFF4E6;
    color: #FF8B00;
}

.status-success {
    background: #E3FCEF;
    color: #006644;
}

.status-error {
    background: #FFEBE6;
    color: #DE350B;
}

.remove-file-btn {
    background: #DE350B;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    margin-left: 8px;
}

.remove-file-btn:hover {
    background: #BF2600;
}

.upload-progress {
    display: none;
    margin: 16px 0;
    background: #F4F5F7;
    border-radius: 4px;
    overflow: hidden;
    height: 8px;
}

.upload-progress.show {
    display: block;
}

.upload-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #36B37E, #00875A);
    width: 0%;
    transition: width 0.3s ease;
}

.upload-status {
    display: none;
    margin: 12px 0;
    font-size: 14px;
    color: #6B778C;
    text-align: center;
}

.upload-status.show {
    display: block;
}

.upload-error {
    background: #FFEBE6;
    color: #DE350B;
    padding: 12px 16px;
    border-radius: 4px;
    margin: 12px 0;
    font-size: 14px;
    display: none;
    border: 1px solid #FFBDAD;
}

.upload-error.show {
    display: block;
}

.upload-success {
    background: #E3FCEF;
    color: #006644;
    padding: 12px 16px;
    border-radius: 4px;
    margin: 12px 0;
    font-size: 14px;
    border: 1px solid #ABF5D1;
    display: none;
}

.upload-success.show {
    display: block;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    align-items: center;
}

.btn {
    background: #36B37E;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:hover:not(:disabled) {
    background: #00875A;
    transform: translateY(-1px);
}

.btn:disabled {
    background: #A5ADBA;
    cursor: not-allowed;
    transform: none;
}

.btn.secondary {
    background: #F4F5F7;
    color: #42526E;
    border: 1px solid #DFE1E6;
}

.btn.secondary:hover:not(:disabled) {
    background: #EBECF0;
    border-color: #C1C7D0;
}

.btn .spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

.btn.uploading .spinner {
    display: inline-block;
}

.btn.uploading .btn-text {
    display: none;
}

.file-count-badge {
    background: #36B37E;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

/* ==========================================================================
   Lists
   ========================================================================== */

.program-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.program-item {
    background: #F4F5F7;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
}

.university-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.university-item {
    background: #E3FCEF;
    color: #006644;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
}

/* ==========================================================================
   Responsive Design - Tablet
   ========================================================================== */

@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Responsive Design - Mobile
   ========================================================================== */

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .profile-main {
        grid-template-columns: 1fr;
        gap: 16px;
        text-align: center;
    }

    .profile-actions {
        flex-direction: row;
        justify-content: center;
    }

    .main-content {
        padding: 16px;
    }

    .profile-header {
        padding: 24px 16px;
    }

    .info-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .modal-content {
        width: 95%;
        padding: 24px;
    }

    .timeline-list {
        padding: 16px;
    }

    .timeline-item {
        padding: 16px;
    }

    .timeline-header {
        padding: 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .timeline-stats {
        text-align: left;
        width: 100%;
    }

    .timeline-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .timeline-item-title-row {
        width: 100%;
        flex-wrap: wrap;
    }

    .timeline-item-date {
        align-self: flex-start;
        margin-top: 8px;
    }

    .timeline-item-title {
        font-size: 16px;
    }

    .timeline-actions {
        flex-direction: column;
        gap: 8px;
    }

    .timeline-btn {
        width: 100%;
        justify-content: center;
    }

    .payment-btn {
        width: 100%;
        justify-content: center;
    }

    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .file-status {
        margin-left: 0;
        align-self: flex-start;
    }

    .remove-file-btn {
        margin-left: 0;
        align-self: flex-end;
    }
}