/**
 * Custom styles for Sistem Permohonan Keluar
 */

/* Animation Keyframes */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translateY(0);
    }
    40%, 43% {
        transform: translateY(-8px);
    }
    70% {
        transform: translateY(-4px);
    }
    90% {
        transform: translateY(-2px);
    }
}

/* Accessibility: Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Navbar text color customization - Force black text */
.navbar.is-primary .navbar-brand .navbar-item,
.navbar.is-primary .navbar-brand .navbar-link,
.navbar.is-primary .navbar-start .navbar-item,
.navbar.is-primary .navbar-start .navbar-link,
.navbar.is-primary .navbar-end .navbar-item,
.navbar.is-primary .navbar-end .navbar-link,
.navbar.is-primary .navbar-item,
.navbar.is-primary .navbar-link,
.navbar.is-primary a.navbar-item,
.navbar.is-primary a.navbar-link {
    color: #000000 !important;
    text-shadow: none !important;
}

.navbar.is-primary .navbar-brand .navbar-item:hover,
.navbar.is-primary .navbar-brand .navbar-link:hover,
.navbar.is-primary .navbar-start .navbar-item:hover,
.navbar.is-primary .navbar-start .navbar-link:hover,
.navbar.is-primary .navbar-end .navbar-item:hover,
.navbar.is-primary .navbar-end .navbar-link:hover,
.navbar.is-primary .navbar-item:hover,
.navbar.is-primary .navbar-link:hover,
.navbar.is-primary a.navbar-item:hover,
.navbar.is-primary a.navbar-link:hover {
    color: #333333 !important;
    background-color: rgba(0, 0, 0, 0.1) !important;
}

.navbar.is-primary .navbar-dropdown .navbar-item,
.navbar.is-primary .navbar-dropdown a.navbar-item {
    color: #000000 !important;
}

.navbar.is-primary .navbar-dropdown .navbar-item:hover,
.navbar.is-primary .navbar-dropdown a.navbar-item:hover {
    color: #000000 !important;
    background-color: #f5f5f5 !important;
}

/* Additional specific targeting for icons and text */
.navbar.is-primary .navbar-item i,
.navbar.is-primary .navbar-link i,
.navbar.is-primary .navbar-item .fas,
.navbar.is-primary .navbar-link .fas {
    color: #000000 !important;
}

/* Force override for any strong tags in navbar */
.navbar.is-primary strong {
    color: #000000 !important;
}

/* Add some padding to the top of the body */
body {
    padding-top: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.5s ease-in-out;
}

/* Make the footer stick to the bottom */
.footer {
    margin-top: auto;
    padding: 2rem 1.5rem;
}

/* Card styling */
.card {
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 3px rgba(10, 10, 10, 0.1), 0 0 0 1px rgba(10, 10, 10, 0.1);
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease-out;
}

.card:hover {
    box-shadow: 0 4px 6px rgba(10, 10, 10, 0.1), 0 0 0 1px rgba(10, 10, 10, 0.1);
    transform: translateY(-2px);
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 0.25em 0.75em;
    border-radius: 290486px;
    font-size: 0.85em;
    font-weight: bold;
}

.status-badge.is-pending {
    background-color: #ffdd57;
    color: rgba(0, 0, 0, 0.7);
}

.status-badge.is-approved {
    background-color: #48c774;
    color: #fff;
}

.status-badge.is-rejected {
    background-color: #f14668;
    color: #fff;
}

/* Dashboard stats */
.dashboard-stats .card {
    height: 100%;
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(10,10,10,0.08);
    transition: transform .2s ease, box-shadow .2s ease;
    color: #fff !important; /* force readable text on colored tiles */
}
.dashboard-stats .card:hover{
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(10,10,10,0.12);
}
.dashboard-stats .card .stat-value{
    font-size: 2.25rem;
    font-weight: 900;
    line-height: 1;
    color:#fff !important;
    text-shadow: 0 1px 2px rgba(0,0,0,.35);
    filter: drop-shadow(0 1px 1px rgba(0,0,0,.25));
}
.dashboard-stats .card .stat-label{
    font-size: 1rem;
    opacity: 1;
    color:#ffffffd9 !important;
    font-weight: 700;
    letter-spacing:.2px;
    text-shadow: 0 1px 1px rgba(0,0,0,.3);
}
/* Progress bars removed per feedback */
.dashboard-stats .progress{
    display: none !important;
}
.dashboard-stats .progress::-webkit-progress-value { background: none !important; }
.dashboard-stats .progress::-moz-progress-bar { background: none !important; }

.dashboard-stats .card:nth-child(1) { animation-delay: 0.1s; }
.dashboard-stats .card:nth-child(2) { animation-delay: 0.2s; }
.dashboard-stats .card:nth-child(3) { animation-delay: 0.3s; }
.dashboard-stats .card:nth-child(4) { animation-delay: 0.4s; }

.dashboard-stats .card-content {
    padding: 1.5rem;
    position: relative;
}
/* Remove overlay that created darker top/bottom two-tone */
.dashboard-stats .card .card-content::before{
    content: none;
}

.dashboard-stats .stat-value {
    font-size: 2.6rem;
    font-weight: 900;
    color:#fff !important;
    text-shadow: 0 1px 2px rgba(0,0,0,.35);
}

.dashboard-stats .stat-label {
    font-size: 1.05rem;
    color: #ffffffd9 !important;
    font-weight:700;
    letter-spacing:.2px;
    text-shadow: 0 1px 1px rgba(0,0,0,.3);
}

/* Slight brightness reduction on vivid tiles for contrast */
.dashboard-stats .card.is-warning,
.dashboard-stats .card.is-info,
.dashboard-stats .card.is-success,
.dashboard-stats .card.is-danger{
    filter: saturate(.95) brightness(.95);
}

/* Application form */
.application-form .field {
    margin-bottom: 1.5rem;
}

/* Signature area */
.signature-pad {
    border: 1px dashed #dbdbdb;
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 1rem;
    text-align: center;
}

.signature-preview {
    max-width: 300px;
    max-height: 100px;
    margin: 1rem 0;
    border: 1px solid #ccc;
    padding: 5px;
    background-color: #fff;
}

/* Login/Register forms */
.auth-form {
    max-width: 500px;
    margin: 2rem auto;
}

/* Application details */
.application-details .field {
    margin-bottom: 1.5rem;
}

.application-details .label {
    font-weight: bold;
}

/* Button animations */
.button {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.button.is-primary {
    background: linear-gradient(135deg, #3273dc 0%, #209cee 100%);
}

.button.is-primary:hover {
    background: linear-gradient(135deg, #2366d1 0%, #1e90ff 100%);
}

/* Shimmer effect for primary buttons */
.button.is-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.button.is-primary:hover::before {
    left: 100%;
}

/* Form field animations */
.field {
    animation: fadeInUp 0.6s ease-out;
}

.field:nth-child(1) { animation-delay: 0.1s; }
.field:nth-child(2) { animation-delay: 0.2s; }
.field:nth-child(3) { animation-delay: 0.3s; }
.field:nth-child(4) { animation-delay: 0.4s; }
.field:nth-child(5) { animation-delay: 0.5s; }

.input, .textarea, .select select {
    transition: all 0.3s ease;
}

.input:focus, .textarea:focus, .select select:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(50, 115, 220, 0.2);
}

/* Table animations */
.table tbody tr {
    animation: fadeInUp 0.4s ease-out;
    transition: background-color 0.3s ease;
}

.table tbody tr:nth-child(odd) { animation-delay: 0.1s; }
.table tbody tr:nth-child(even) { animation-delay: 0.2s; }

.table tbody tr:hover {
    background-color: rgba(50, 115, 220, 0.05);
    transform: translateX(2px);
}

/* Navigation animations */
.navbar {
    animation: slideInDown 0.5s ease-out;
}

.navbar-item {
    transition: all 0.3s ease;
}

.navbar-item:hover {
    transform: translateY(-1px);
}

/* Loading animation */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Notification animations */
.notification {
    animation: slideInRight 0.5s ease-out;
}

/* Status badge animations */
.status-badge {
    transition: all 0.3s ease;
}

.status-badge:hover {
    transform: scale(1.05);
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .navbar, .footer, button, .notification {
        display: none !important;
    }
    
    body {
        padding: 0;
        margin: 0;
    }
    
    .container {
        width: 100%;
        max-width: none;
    }
}
/* Preview Modal — Scoped Styles
   These styles only target the redesigned preview HTML output from buildPreviewHtml()
   in public/create_application.php to avoid unintended side effects.
-------------------------------------------------------------- */
.ts-datetime-field {
    max-width: 360px;
}
.ts-datetime-field .control {
    position: relative;
}
.ts-datetime-field .control .icon.is-right {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}
.preview-wrap {
  font-size: 0.95rem;
  color: #2b2b2b;
}
.preview-wrap .preview-header.notification {
  border-left: 4px solid #3273dc; /* Bulma primary */
  padding: 0.9rem 1rem;
  margin-bottom: 0.75rem;
}
.preview-wrap .preview-header .title {
  font-size: 1.05rem;
  margin: 0;
}
.preview-wrap .preview-header .subtitle {
  font-size: 0.9rem;
  margin: 0.2rem 0 0;
  color: #4a4a4a;
}

.preview-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 1rem;
}
.preview-summary .preview-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #f5f7fb;
  color: #1f2d3d;
  border: 1px solid #e3e8f0;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.85rem;
  line-height: 1;
  white-space: nowrap;
  font-weight: 600;
}
.preview-summary .preview-badge .icon {
  color: #4a6cf7; /* accent icon color */
  font-size: 0.9rem;
}

.preview-banner {
  display: none; /* default hidden; toggle visible by JS when needed */
  margin: 0.25rem 0 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: 0.4rem;
  font-size: 0.9rem;
  border: 1px solid transparent;
}
.preview-banner.is-success {
  display: block;
  background: #effaf3;
  color: #276749;
  border-color: #c6f6d5;
}
.preview-banner.is-warning {
  display: block;
  background: #fffaf0;
  color: #7b341e;
  border-color: #feebc8;
}
.preview-banner .icon {
  margin-right: 0.4rem;
}

.preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
  margin-bottom: 1rem;
}
@media (max-width: 768px) {
  .preview-grid {
    grid-template-columns: 1fr;
  }
}
.preview-section {
  background: #ffffff;
  border: 1px solid #eceff4;
  border-radius: 0.5rem;
  padding: 0.9rem 0.95rem;
}
.preview-section h4 {
  font-size: 1rem;
  font-weight: 700;
  color: #1f2d3d;
  margin: 0 0 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.preview-section h4 .icon {
  color: #3273dc; /* Bulma primary */
  font-size: 0.95rem;
}
.preview-section dl {
  margin: 0;
}
.preview-section dl .row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 0.75rem;
  padding: 0.45rem 0;
  border-top: 1px dashed #eef2f7;
}
.preview-section dl .row:first-child {
  border-top: 0;
}
.preview-section dl dt {
  font-weight: 700;
  color: #1a202c;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  text-transform: none;
}
.preview-section dl dt::after {
  content: ":";
  margin-left: 0.25rem;
  color: #a0aec0;
  font-weight: 400;
}
.preview-section dl dd {
  margin: 0;
  color: #2d3748;
  font-size: 0.95rem;
  font-weight: 500;
  word-break: break-word;
}

.preview-attachment {
  background: #fbfdff;
  border: 1px solid #e6eefc;
  border-radius: 0.5rem;
  padding: 0.85rem 0.95rem;
}
.preview-attachment h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1f2d3d;
  margin: 0 0 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.preview-attachment h4 .icon {
  color: #485fc7; /* Bulma link color */
  font-size: 0.95rem;
}
.preview-attachment .file-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.6rem;
  background: #ffffff;
  border: 1px solid #edf2f7;
  border-radius: 0.45rem;
}
.preview-attachment .file-icon {
  width: 36px;
  height: 36px;
  border-radius: 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f1f5ff;
  color: #485fc7;
  flex: 0 0 36px;
  font-size: 1rem;
}
.preview-attachment .file-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.preview-attachment .file-name {
  font-size: 0.92rem;
  color: #2b2b2b;
  font-weight: 500;
}
.preview-attachment .pill {
  line-height: 1;
  border-radius: 999px;
  padding: 0.3rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid transparent;
}
.preview-attachment .pill.ok {
  background: #e6fffa;
  color: #107a66;
  border-color: #b2f5ea;
}
.preview-attachment .pill.bad {
  background: #fff5f5;
  color: #9b2c2c;
  border-color: #fed7d7;
}

/* Minor utility when preview appears inside Bulma modal content */
.modal .modal-card-body .preview-wrap,
.modal .modal-content .preview-wrap {
  margin-top: 0.25rem;
}