/**
 * TUH IPTV - Frontend Styles
 *
 * @package TUH_IPTV
 * @since 1.0.0
 */

/* =========================================
   Variables
   ========================================= */
:root {
    --tuh-primary: #3b82f6;
    --tuh-primary-dark: #2563eb;
    --tuh-success: #10b981;
    --tuh-warning: #f59e0b;
    --tuh-danger: #ef4444;
    --tuh-gray: #6b7280;
    --tuh-light: #f3f4f6;
    --tuh-border: #e5e7eb;
    --tuh-radius: 8px;
    --tuh-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* =========================================
   Container
   ========================================= */
.tuh-iptv-frontend {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* =========================================
   No Subscription
   ========================================= */
.tuh-iptv-no-subscription {
    text-align: center;
    padding: 60px 20px;
    background: var(--tuh-light);
    border-radius: var(--tuh-radius);
}

.tuh-iptv-no-subscription .tuh-iptv-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--tuh-primary), var(--tuh-primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tuh-iptv-no-subscription .dashicons {
    font-size: 40px;
    width: 40px;
    height: 40px;
    color: #fff;
}

.tuh-iptv-no-subscription h3 {
    margin: 0 0 10px;
    font-size: 20px;
    color: #1f2937;
}

.tuh-iptv-no-subscription p {
    margin: 0;
    color: var(--tuh-gray);
}

/* =========================================
   Status Card
   ========================================= */
.tuh-iptv-status-card {
    background: #fff;
    border: 1px solid var(--tuh-border);
    border-radius: var(--tuh-radius);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--tuh-shadow);
}

.status-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.status-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1f2937;
}

.status-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-size: 13px;
    color: var(--tuh-gray);
    margin-bottom: 4px;
}

.detail-value {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

/* =========================================
   Alert
   ========================================= */
.tuh-iptv-alert {
    padding: 12px 16px;
    border-radius: var(--tuh-radius);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tuh-iptv-alert.warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.tuh-iptv-alert .dashicons {
    flex-shrink: 0;
}

/* =========================================
   Credentials Card
   ========================================= */
.tuh-iptv-credentials-card {
    background: #fff;
    border: 1px solid var(--tuh-border);
    border-radius: var(--tuh-radius);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--tuh-shadow);
}

.tuh-iptv-credentials-card h3 {
    margin: 0 0 20px;
    font-size: 18px;
    color: #1f2937;
}

.credential-item {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--tuh-border);
}

.credential-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.credential-item label {
    display: block;
    font-size: 13px;
    color: var(--tuh-gray);
    margin-bottom: 6px;
    font-weight: 500;
}

.credential-value {
    display: flex;
    align-items: center;
    gap: 8px;
}

.credential-value code {
    background: var(--tuh-light);
    padding: 8px 12px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 14px;
    color: #1f2937;
}

.credential-url {
    flex-wrap: wrap;
}

.tuh-iptv-url-input {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid var(--tuh-border);
    border-radius: 6px;
    font-family: monospace;
    font-size: 13px;
    background: var(--tuh-light);
}

/* =========================================
   Password Field
   ========================================= */
.tuh-iptv-password-field {
    display: inline-flex;
    align-items: center;
    background: var(--tuh-light);
    padding: 8px 12px;
    border-radius: 6px;
    font-family: monospace;
}

/* =========================================
   Buttons
   ========================================= */
.tuh-iptv-toggle-password,
.tuh-iptv-copy-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--tuh-gray);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.tuh-iptv-toggle-password:hover,
.tuh-iptv-copy-btn:hover {
    color: var(--tuh-primary);
    background: var(--tuh-light);
}

.tuh-iptv-copy-btn.copied {
    color: var(--tuh-success);
}

/* =========================================
   Badge
   ========================================= */
.tuh-iptv-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
}

/* =========================================
   Tutorials Card
   ========================================= */
.tuh-iptv-tutorials-card {
    background: #fff;
    border: 1px solid var(--tuh-border);
    border-radius: var(--tuh-radius);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--tuh-shadow);
}

.tuh-iptv-tutorials-card h3 {
    margin: 0 0 5px;
    font-size: 18px;
    color: #1f2937;
}

.tuh-iptv-tutorials-card .description {
    margin: 0 0 20px;
    color: var(--tuh-gray);
    font-size: 14px;
}

.tuh-iptv-tutorials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.tutorial-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 15px;
    background: var(--tuh-light);
    border-radius: var(--tuh-radius);
    text-decoration: none;
    color: #1f2937;
    transition: all 0.2s;
}

.tutorial-card:hover {
    background: var(--tuh-primary);
    color: #fff;
    transform: translateY(-2px);
}

.tutorial-card .tutorial-icon {
    font-size: 32px;
    width: 32px;
    height: 32px;
    margin-bottom: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tutorial-card .tutorial-icon .dashicons,
.tutorial-card .tutorial-icon i {
    font-size: 32px;
    width: 32px;
    height: 32px;
}

.tutorial-card .tutorial-title {
    font-size: 13px;
    font-weight: 500;
    text-align: center;
}

.tutorials-link {
    text-align: center;
    margin: 0;
}

.tutorials-link a {
    color: var(--tuh-primary);
    text-decoration: none;
    font-weight: 500;
}

.tutorials-link a:hover {
    text-decoration: underline;
}

/* =========================================
   Page Header
   ========================================= */
.tuh-iptv-page-header {
    margin-bottom: 24px;
}

.tuh-iptv-page-header .back-link {
    display: inline-block;
    color: var(--tuh-gray);
    text-decoration: none;
    margin-bottom: 10px;
    font-size: 14px;
}

.tuh-iptv-page-header .back-link:hover {
    color: var(--tuh-primary);
}

.tuh-iptv-page-header h2 {
    margin: 0 0 8px;
    font-size: 24px;
    color: #1f2937;
}

.tuh-iptv-page-header p {
    margin: 0;
    color: var(--tuh-gray);
}

/* =========================================
   Tutorial Section
   ========================================= */
.tuh-iptv-tutorial-section {
    margin-bottom: 30px;
}

.tuh-iptv-tutorial-section h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 15px;
    font-size: 16px;
    color: #1f2937;
}

.tuh-iptv-tutorial-section h3 .tutorial-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.tuh-iptv-tutorial-section h3 .tutorial-icon .dashicons,
.tuh-iptv-tutorial-section h3 .tutorial-icon i {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.tuh-iptv-tutorials-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tutorial-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--tuh-border);
    border-radius: var(--tuh-radius);
    text-decoration: none;
    color: #1f2937;
    transition: all 0.2s;
}

.tutorial-item:hover {
    border-color: var(--tuh-primary);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.tutorial-item .tutorial-icon {
    width: 44px;
    height: 44px;
    background: var(--tuh-light);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
}

.tutorial-item .tutorial-icon .dashicons,
.tutorial-item .tutorial-icon i {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.tutorial-item:hover .tutorial-icon {
    background: var(--tuh-primary);
    color: #fff;
}

.tutorial-item .tutorial-info {
    flex: 1;
}

.tutorial-item .tutorial-title {
    font-weight: 500;
}

.tutorial-item .tutorial-arrow {
    color: var(--tuh-gray);
}

.tutorial-item:hover .tutorial-arrow {
    color: var(--tuh-primary);
}

/* =========================================
   Tutorial Content
   ========================================= */
.tuh-iptv-tutorial-content {
    background: #fff;
    border: 1px solid var(--tuh-border);
    border-radius: var(--tuh-radius);
    overflow: hidden;
    box-shadow: var(--tuh-shadow);
}

.tutorial-header {
    display: flex;
    align-items: center;
    padding: 24px;
    background: linear-gradient(135deg, var(--tuh-primary), var(--tuh-primary-dark));
    color: #fff;
}

.tutorial-header .tutorial-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
}

.tutorial-header .tutorial-icon .dashicons,
.tutorial-header .tutorial-icon i {
    font-size: 30px;
    width: 30px;
    height: 30px;
}

.tutorial-header .tutorial-device {
    font-size: 13px;
    opacity: 0.8;
    display: block;
    margin-bottom: 4px;
}

.tutorial-header h2 {
    margin: 0;
    font-size: 22px;
}

/* =========================================
   Credentials Box (in tutorial)
   ========================================= */
.tuh-iptv-credentials-box {
    background: var(--tuh-light);
    padding: 20px;
    margin: 24px;
    border-radius: var(--tuh-radius);
}

.tuh-iptv-credentials-box h4 {
    margin: 0 0 5px;
    font-size: 14px;
}

.tuh-iptv-credentials-box .description {
    margin: 0 0 15px;
    font-size: 13px;
    color: var(--tuh-gray);
}

.credentials-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.credential-inline-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--tuh-border);
}

.credential-inline-item.credential-full {
    flex: 1 1 100%;
}

.credential-inline-item .label {
    font-size: 12px;
    color: var(--tuh-gray);
    font-weight: 500;
}

.credential-inline-item code {
    background: var(--tuh-light);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
}

.credential-inline-item .tuh-iptv-url-input {
    flex: 1;
    min-width: 150px;
    border: none;
    background: var(--tuh-light);
    padding: 4px 8px;
    font-size: 12px;
}

/* =========================================
   Tutorial Body
   ========================================= */
.tutorial-body {
    padding: 24px;
    line-height: 1.7;
    color: #374151;
}

.tutorial-body h2,
.tutorial-body h3,
.tutorial-body h4 {
    color: #1f2937;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.tutorial-body p {
    margin-bottom: 1em;
}

.tutorial-body ol,
.tutorial-body ul {
    margin-bottom: 1em;
    padding-left: 1.5em;
}

.tutorial-body li {
    margin-bottom: 0.5em;
}

.tutorial-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--tuh-radius);
    margin: 1em 0;
}

.tutorial-body code {
    background: var(--tuh-light);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

.tutorial-body pre {
    background: #1f2937;
    color: #f9fafb;
    padding: 16px;
    border-radius: var(--tuh-radius);
    overflow-x: auto;
}

.tutorial-body pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* =========================================
   Tutorial Nav
   ========================================= */
.tutorial-nav {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding: 24px;
    border-top: 1px solid var(--tuh-border);
}

.tutorial-nav .button {
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
}

.tutorial-nav .button-primary {
    background: var(--tuh-primary);
    color: #fff;
    border: none;
}

.tutorial-nav .button-primary:hover {
    background: var(--tuh-primary-dark);
}

/* =========================================
   Copyable Elements
   ========================================= */
.tuh-iptv-copyable {
    cursor: pointer;
    transition: background 0.2s;
}

.tuh-iptv-copyable:hover {
    background: #dbeafe;
}

/* =========================================
   Empty State
   ========================================= */
.tuh-iptv-empty {
    text-align: center;
    padding: 40px;
    color: var(--tuh-gray);
}

/* =========================================
   Responsive
   ========================================= */
@media (max-width: 600px) {
    .status-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .tuh-iptv-tutorials-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .tutorial-header {
        flex-direction: column;
        text-align: center;
    }

    .tutorial-header .tutorial-icon {
        margin-right: 0;
        margin-bottom: 15px;
    }

    .credentials-inline {
        flex-direction: column;
    }

    .tutorial-nav {
        flex-direction: column;
    }
}
