@use '../globals' as *;

/**
 * Dashboard Page Styles
 *
 * Styles for the main admin dashboard page.
 *
 * @package MultilingualPressZone
 * @since 1.0.0
 */

/* ==========================================================================
   Dashboard Container
   ========================================================================== */

.ipz-dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: $spacing-lg;

    @media screen and (max-width: 782px) {
        padding: $spacing-md;
    }
}

/* ==========================================================================
   Dashboard Header
   ========================================================================== */

.ipz-dashboard__header {
    margin-bottom: $spacing-xl;

    h1 {
        font-size: 28px;
        font-weight: 600;
        color: $text-primary;
        margin: 0 0 $spacing-xs 0;
    }
}

.ipz-dashboard__subtitle {
    font-size: 14px;
    color: $text-secondary;
    margin: 0;
}

/* ==========================================================================
   Stats Cards Section
   ========================================================================== */

.ipz-dashboard__stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: $spacing-lg;
    margin-bottom: $spacing-xl;

    @media screen and (max-width: 782px) {
        grid-template-columns: 1fr;
        gap: $spacing-md;
    }
}

.ipz-stat-card {
    display: flex;
    align-items: center;
    gap: $spacing-md;
    padding: $spacing-lg;
    background: $background-white;
    border: 1px solid $border-color;
    border-radius: $border-radius-lg;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all $transition-normal;

    &:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        transform: translateY(-2px);
    }
}

.ipz-stat-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, $primary-color 0%, $secondary-color 100%);
    border-radius: $border-radius-lg;
    flex-shrink: 0;

    .dashicons {
        font-size: 32px;
        width: 32px;
        height: 32px;
        color: $background-white;
    }
}

.ipz-stat-card__content {
    flex: 1;
    min-width: 0;
}

.ipz-stat-card__value {
    font-size: 28px;
    font-weight: 700;
    color: $text-primary;
    line-height: 1.2;
    margin-bottom: $spacing-xs;
}

.ipz-stat-card__label {
    font-size: 13px;
    font-weight: 500;
    color: $text-secondary;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   Recent Jobs Section
   ========================================================================== */

.ipz-dashboard__recent-jobs {
    margin-bottom: $spacing-xl;

    h2 {
        font-size: 20px;
        font-weight: 600;
        color: $text-primary;
        margin-bottom: $spacing-lg;
    }
}

.ipz-dashboard__table-container {
    background: $background-white;
    border: 1px solid $border-color;
    border-radius: $border-radius-lg;
    padding: $spacing-lg;

    @media screen and (max-width: 782px) {
        padding: $spacing-md;
        overflow-x: auto;
    }
}

.ipz-dashboard__job-title {
    font-weight: 500;
    color: $primary-color;
    text-decoration: none;
    transition: color $transition-fast;

    &:hover {
        color: $primary-hover;
        text-decoration: underline;
    }

    &:focus {
        outline: 2px solid $primary-color;
        outline-offset: 2px;
        border-radius: $border-radius-sm;
    }
}

.ipz-dashboard__languages {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 500;
    color: $text-secondary;
    padding: $spacing-xs $spacing-sm;
    background: $background-light;
    border-radius: $border-radius-sm;
}

/* ==========================================================================
   Quick actions
   ========================================================================== */

.ipz-dashboard__action-buttons {
    display: flex;
    flex-direction: column;
    gap: $spacing-sm;

    button {
        width: 100%;
        justify-content: flex-start;
    }
}

/* ==========================================================================
   Loading and Error States
   ========================================================================== */

.ipz-dashboard__loading,
.ipz-dashboard__error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: $spacing-xl;
    text-align: center;

    p {
        color: $text-secondary;
        margin-top: $spacing-md;
    }
}

.ipz-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid $background-light;
    border-top-color: $primary-color;
    border-radius: 50%;
    animation: ipz-spin 0.8s linear infinite;
}



.ipz-dashboard__error {
    p {
        color: $error-color;
    }
}



/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media screen and (max-width: 782px) {
    .ipz-stat-card__icon {
        width: 48px;
        height: 48px;

        .dashicons {
            font-size: 28px;
            width: 28px;
            height: 28px;
        }
    }

    .ipz-stat-card__value {
        font-size: 24px;
    }

    .ipz-stat-card__label {
        font-size: 12px;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .ipz-dashboard__actions,
    .ipz-dashboard__system-status {
        display: none;
    }

    .ipz-stat-card {
        box-shadow: none;
        border: 1px solid #000;
    }
}

.presszone-international-dashboard__stats {
    margin-bottom: $spacing-lg;
}

.presszone-international-dashboard__stats,
.ipz-dashboard__table-container {
    .international-skeleton {
        background: $background-light;
        border-radius: $border-radius-sm;
        height: 14px;
    }

    .international-skeleton--circle {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        flex-shrink: 0;
    }

    .international-skeleton-stat-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: $spacing-md;
    }

    .international-skeleton-stat-grid__card {
        display: flex;
        align-items: center;
        gap: $spacing-md;
        padding: $spacing-lg;
        background: $background-white;
        border: 1px solid $border-color;
        border-radius: $border-radius-lg;
    }

    .international-skeleton-stat-grid__content {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: $spacing-sm;
    }

    .international-skeleton-table {
        width: 100%;
        border-collapse: collapse;
    }

    .international-skeleton-table__row td {
        padding: $spacing-sm $spacing-md;
        border-bottom: 1px solid $border-color;
    }
}
