@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #2196F3;
    --secondary-color: #f8f9fa;
    --text-color: #333;
}

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: linear-gradient(135deg, #4da9ff 0%, #2196F3 100%);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
}

.main-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 0;
    width: 100%;
}

.top-section {
    padding: 2rem 1rem;
}

.bottom-section {
    background: white;
    border-radius: 50px 50px 0 0;
    padding: 2rem 0;
    margin-top: 0.5rem;
    flex-grow: 1;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.bottom-section > .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.logo {
    width: 100px;
    height: auto;
    margin-bottom: 1.5rem;
}

.welcome-text {
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.system-name {
    color: white;
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.institution-name {
    color: white;
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.user-card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    width: 100%;
    border: 1px solid rgba(0, 0, 0, 0.1);
    position: relative;
}

.user-card .d-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
}

.profile-section {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    flex: 0 0 auto;
    width: auto;
    max-width: 400px;
}

.avatar-container {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.user-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.user-info {
    padding-left: 1.5rem;
    font-size: 0.9rem;
}

.info-row {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.info-row i {
    color: var(--primary-color);
    width: 20px;
    font-size: 0.9rem;
}

.letter-info {
    text-align: left;
    flex: 1;
    max-width: 450px;
}

.surat-section {
    margin-bottom: 1rem;
}

.surat-section:last-child {
    margin-bottom: 0;
}

.surat-title {
    color: var(--text-color);
    font-weight: 500;
    margin-left: 10px;
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
    text-align: left;
}

.letter-info .info-row {
    display: flex;
    gap: 0.3rem;
    margin-bottom: 0.5rem;
    margin-left: 10px;
    align-items: baseline;
    justify-content: flex-start;
}

.letter-info .info-row span {
    font-size: 0.9rem;
    color: var(--text-color);
    text-align: left;
}

.letter-info .info-row span:first-child {
    color: var(--text-color);
    min-width: 85px;
    text-align: left;
}

.ambil-nomor-text {
    color: var(--text-color);
    font-size: 1.3rem;
    font-weight: 500;
    margin: 2rem 0;
    opacity: 0.9;
}

.menu-wrapper {
    width: 100%;
    padding: 0 1rem;
    margin: 0 auto;
    max-width: 600px;
}

.letter-buttons-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin: 0;
    gap: 8px;
}

.btn-letter {
    width: calc(33.333% - 6px);
    padding: 1rem 0;
    text-decoration: none;
    color: var(--primary-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0;
    transition: transform 0.3s ease;
    background: transparent;
}

.btn-letter .icon-circle {
    width: 60px;
    height: 60px;
    background-color: #2196F3;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.btn-letter .icon-circle i {
    color: white;
    font-size: 1.5rem;
}

.btn-letter p {
    margin: 0;
    padding: 0;
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.9rem;
    text-align: center;
    width: 100%;
}

.btn-letter:hover {
    transform: translateY(-5px);
    background: transparent;
}

.btn-letter:hover .icon-circle {
    transform: scale(1.1);
    background-color: #1976D2;
    box-shadow: 0 4px 8px rgba(33, 150, 243, 0.3);
}

footer {
    color: var(--text-color);
    margin-top: 3rem;
    font-size: 0.9rem;
    text-align: center;
}

.profile-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.update-profile-btn, .logout-btn, .btn-detail {
    font-size: 0.72rem;
    padding: 0.32rem 0.7rem;
    border-radius: 7px;
    gap: 0.35rem;
    min-width: 80px;
    height: 32px;
    font-weight: 500;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: auto;
}

.update-profile-btn {
    background-color: #54B435;
    color: #fff;
}

.logout-btn {
    background-color: #dc3545;
    color: #fff;
}

.btn-detail {
    background-color: #17c1ef;
    color: #080808;
}

.update-profile-btn i, .logout-btn i, .btn-detail i {
    font-size: 0.9em;
}

.update-profile-btn:hover {
    background-color: #379237;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    color: white;
}

.logout-btn:hover {
    background-color: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    color: white;
}

/* Update Profile Page Styles */
.update-profile-card {
    background: white;
    border-radius: none;
    padding: 2rem;
    box-shadow: none;
    margin-bottom: 2rem;
    border: none;
}

.avatar-upload {
    position: relative;
    max-width: 180px;
    margin: 0 auto;
}

.avatar-preview {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    margin-bottom: 1rem;
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.change-photo-btn {
    background-color: var(--primary-color);
    color: white !important;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.change-photo-btn i,
.change-photo-btn span {
    color: white;
}

.change-photo-btn:hover {
    background-color: #1976D2;
    transform: translateY(-2px);
    color: white;
}

.change-photo-btn:hover i,
.change-photo-btn:hover span {
    color: white;
}

.profile-form label {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.profile-form .input-group-text {
    background-color: var(--primary-color);
    border: none;
    color: white;
}

.profile-form .form-control {
    border: 1px solid #e0e0e0;
    padding: 0.6rem;
}

.profile-form .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(33, 150, 243, 0.25);
}

.form-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

.form-buttons .btn {
    padding: 0.5rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.form-buttons .btn-secondary {
    background-color: #6c757d;
    border: none;
}

.form-buttons .btn-primary {
    background-color: var(--primary-color);
    border: none;
}

.form-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Tombol Detail agar sama dengan Update dan Logout */
.btn-detail:hover, .btn-detail:focus {
    background-color: #0fa4c9;
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(23, 193, 239, 0.15);
}

@media (max-width: 768px) {
    .logo {
        width: 60px;
        margin-bottom: 1rem;
    }

    .welcome-text {
        font-size: 1.4rem;
        margin-bottom: 0.3rem;
    }
    
    .system-name {
        font-size: 1rem;
        line-height: 1.4;
        margin-bottom: 0.3rem;
    }
    
    .institution-name {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }

    .bottom-section {
        border-radius: 30px 30px 0 0;
        padding: 1.5rem 0;
        margin-top: 0.5rem;
    }

    .user-card .d-flex {
        flex-direction: column;
        gap: 1rem;
    }

    .profile-section {
        width: 100%;
        max-width: none;
    }

    .avatar-container {
        width: 70px;
        height: 70px;
    }
    
    .user-info {
        padding-left: 1rem;
        margin-bottom: 0;
    }

    .info-row {
        font-size: 0.85rem;
        margin-bottom: 0.3rem;
    }
    
    .letter-info {
        width: 100%;
        max-width: none;
        text-align: left;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid rgba(0, 0, 0, 0.1);
    }

    .letter-info .info-row {
        margin-bottom: 0.3rem;
        gap: 0.3rem;
        display: flex;
        align-items: baseline;
    }

    .letter-info .info-row span:first-child {
        min-width: 85px;
    }

    .letter-info .info-row span {
        font-size: 0.85rem;
    }

    .surat-title {
        margin-bottom: 0.5rem;
        font-size: 0.9rem;
    }

    .menu-wrapper {
        padding: 0 0.75rem;
    }

    .letter-buttons-container {
        gap: 6px;
    }

    .btn-letter {
        width: calc(33.333% - 4px);
        padding: 0.75rem 0;
    }

    .btn-letter .icon-circle {
        width: 45px;
        height: 45px;
    }

    .btn-letter .icon-circle i {
        font-size: 1.2rem;
    }

    .btn-letter p {
        font-size: 0.75rem;
        margin-top: 0.3rem;
    }

    .ambil-nomor-text {
        font-size: 1.2rem;
        margin: 1.5rem 0;
    }

    footer {
        font-size: 0.8rem;
        margin-top: 2rem;
    }

    .profile-buttons {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .update-profile-btn, .logout-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    .update-profile-card {
        padding: 1.5rem;
    }

    .avatar-preview {
        width: 110px;
        height: 110px;
    }

    .change-photo-btn {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }

    .profile-form label {
        font-size: 0.85rem;
    }

    .form-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }

    .form-buttons .btn {
        width: 100%;
        justify-content: center;
    }

    .avatar-upload {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
    .change-photo-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

@media (max-width: 360px) {
    .welcome-text {
        font-size: 1.2rem;
    }
    
    .system-name {
        font-size: 0.9rem;
    }
    
    .institution-name {
        font-size: 0.8rem;
    }

    .user-card {
        padding: 0.8rem;
    }

    .avatar-container {
        width: 60px;
        height: 60px;
    }

    .user-info {
        padding-left: 0.8rem;
    }

    .info-row {
        font-size: 0.8rem;
        margin-bottom: 0.2rem;
    }

    .letter-info {
        margin-top: 0.4rem;
        padding-top: 0.4rem;
    }

    .letter-info .info-row span:first-child {
        min-width: 75px;
    }

    .letter-info .info-row {
        gap: 0.2rem;
    }

    .menu-wrapper {
        padding: 0 0.5rem;
    }

    .letter-buttons-container {
        gap: 4px;
    }

    .btn-letter {
        width: calc(33.333% - 3px);
        padding: 0.5rem 0;
    }

    .btn-letter .icon-circle {
        width: 40px;
        height: 40px;
    }

    .btn-letter .icon-circle i {
        font-size: 1rem;
    }

    .btn-letter p {
        font-size: 0.7rem;
        margin-top: 0.2rem;
    }

    .profile-buttons {
        width: 100%;
    }

    .update-profile-btn, .logout-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }

    .update-profile-card {
        padding: 1rem;
    }

    .avatar-preview {
        width: 120px;
        height: 120px;
    }

    .change-photo-btn {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }

    .surat-title {
        font-size: 0.85rem;
    }

    .letter-info .info-row span:first-child {
        min-width: 75px;
    }
}

.surat-keluar-form textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.surat-keluar-form textarea.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(33, 150, 243, 0.25);
}

/* Surat Masuk Form Styles */
.surat-masuk-form {
    background: white;
    border-radius: none;
    padding: 2rem;
    box-shadow: none;
    margin-bottom: 2rem;
    border: none;
}

.surat-masuk-form .form-label {
    color: var(--text-color);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.surat-masuk-form .form-control,
.surat-masuk-form .form-select {
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0.75rem;
    transition: all 0.3s ease;
}

.surat-masuk-form .form-control:focus,
.surat-masuk-form .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(33, 150, 243, 0.25);
}

.surat-masuk-form textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* Responsive styles for Surat Masuk */
@media (max-width: 768px) {
    .surat-masuk-form {
        padding: 1.5rem;
    }
    
    .surat-masuk-form .form-label {
        font-size: 0.9rem;
    }
    
    .surat-masuk-form .form-control,
    .surat-masuk-form .form-select {
        padding: 0.6rem;
    }
}

@media (max-width: 360px) {
    .surat-masuk-form {
        padding: 1rem;
    }
    
    .surat-masuk-form .form-label {
        font-size: 0.85rem;
    }
}

/* Login Form Styles */
.login-form {
    background: white;
    border-radius: 15px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
}

.login-form h4 {
    color: var(--text-color);
    font-weight: 600;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.login-form .form-label {
    color: var(--text-color);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.login-form .input-group-text {
    background-color: var(--primary-color);
    border: none;
    color: white;
    width: 45px;
    justify-content: center;
}

.login-form .input-group-text i {
    font-size: 1rem;
}

.login-form .form-control {
    border-radius: 0 8px 8px 0;
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0.75rem;
    height: auto;
    font-size: 1rem;
}

.login-form .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: none;
}

.btn-login {
    padding: 0.8rem;
    font-weight: 500;
    font-size: 1.1rem;
    border-radius: 8px;
    background-color: var(--primary-color);
    border: none;
    transition: all 0.3s ease;
}

.btn-login:hover {
    background-color: #1976D2;
}

.login-form .small-text {
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 0;
}

/* Responsive styles for Login */
@media (max-width: 768px) {
    .login-form {
        padding: 2rem;
        margin: 0 1rem;
    }

    .login-form h4 {
        font-size: 1.3rem;
        margin-bottom: 1.2rem;
    }

    .login-form .form-control {
        font-size: 0.95rem;
    }

    .btn-login {
        padding: 0.7rem;
        font-size: 1rem;
    }

    .login-form .small-text {
        font-size: 0.8rem;
    }
}

@media (max-width: 360px) {
    .login-form {
        padding: 1.5rem;
    }

    .login-form h4 {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }

    .login-form .input-group-text {
        width: 40px;
    }

    .login-form .form-control {
        font-size: 0.9rem;
        padding: 0.6rem;
    }

    .btn-login {
        padding: 0.6rem;
        font-size: 0.95rem;
    }
}

/* Modal Bootstrap selalu di tengah layar */
.modal-dialog {
    display: flex;
    align-items: center;
    min-height: calc(100vh - 1rem);
}
.modal.fade .modal-dialog {
    transition: transform 0.3s ease-out;
    transform: translateY(0);
}

/* Modal Detail Surat Keluar - font kecil dan header tidak bold */
#modalDetailSurat .modal-content {
    font-size: 0.95rem;
}
#modalDetailSurat .modal-title {
    font-weight: 400;
    font-size: 1.15rem;
}
#modalDetailSurat .btn-close {
    font-size: 1.1rem;
}
#modalDetailSurat .modal-footer .btn {
    font-size: 0.95rem;
    padding: 0.35rem 1.2rem;
}

/* Preloader Styles */
#preloader {
    position: fixed;
    left: 0; top: 0; right: 0; bottom: 0;
    background: #f8f9fa;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.loader {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #2196F3;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg);}
    100% { transform: rotate(360deg);}
}
.loading-text {
    margin-top: 20px;
    font-size: 1.2rem;
    color: #333;
    text-align: center;
}

.form-inner-spacing {
    margin-top: 32px; /* Atur sesuai kebutuhan */
}

@media (max-width: 500px) {
    .modal-dialog {
        max-width: 95vw;
        margin: 1.5rem auto;
    }
    .modal-content {
        padding: 0.5rem;
        font-size: 0.97rem;
    }
    .modal-header, .modal-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }
} 