/**
 * Frontend CSS za PartnerHUB
 */

/* Osnovni stilovi */
.tbm-materials-order {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
}

.tbm-materials-order h2,
.tbm-materials-order h3,
.tbm-materials-order h4,
.tbm-materials-order h5 {
    color: #0066cc;
    margin-top: 0;
}

/* Gumbi */
.tbm-add-to-cart-btn,
.tbm-rental-btn,
.tbm-place-order-btn {
    transition: all 0.3s ease;
    cursor: pointer;
}

.tbm-add-to-cart-btn:hover {
    background: #1e3d6f !important;
    transform: translateY(-1px);
}

.tbm-rental-btn:hover {
    background: #1e7e34 !important;
    transform: translateY(-1px);
}

.tbm-place-order-btn:hover {
    background: #1e7e34 !important;
    transform: translateY(-1px);
}

/* Kartice materialov */
.tbm-material-card {
    transition: all 0.3s ease;
}

.tbm-material-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Košarica */
.tbm-cart-item {
    transition: all 0.3s ease;
}

.tbm-cart-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Modal */
.tbm-modal {
    animation: fadeIn 0.3s ease;
}

.tbm-modal-content {
    animation: slideIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Obvestila */
.notice {
    animation: slideDown 0.3s ease;
    margin-bottom: 20px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tbm-notice {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    font-weight: 500;
    line-height: 1.5;
    position: relative;
    animation: slideDown 0.4s ease-out;
    border: 1px solid transparent;
}

.tbm-notice-error {
    background: #fff5f5;
    color: #c53030;
    border-color: #feb2b2;
    border-left: 5px solid #c53030;
    box-shadow: 0 4px 12px rgba(197, 48, 48, 0.1);
}

.tbm-notice-success {
    background: #f0fff4;
    color: #276749;
    border-color: #9ae6b4;
    border-left: 5px solid #38a169;
    box-shadow: 0 4px 12px rgba(56, 161, 105, 0.1);
}

/* Responsive design */
@media (max-width: 768px) {
    .tbm-materials-order {
        padding: 10px;
    }

    .tbm-budget-info {
        flex-direction: column;
    }

    .tbm-budget-card,
    .tbm-partner-info {
        min-width: auto;
    }

    .tbm-material-prices {
        flex-direction: column;
        gap: 5px;
    }

    .tbm-action-buttons {
        flex-direction: column;
    }

    .tbm-cart-item-controls {
        flex-wrap: wrap;
    }

    .tbm-modal-content {
        width: 95%;
        margin: 20px;
    }
}

@media (max-width: 480px) {
    .tbm-materials-order {
        padding: 5px;
    }

    .tbm-material-card {
        padding: 15px;
    }

    .tbm-cart-section {
        padding: 15px;
    }

    .tbm-modal-body {
        padding: 15px;
    }
}

/* Loading states */
.tbm-loading {
    opacity: 0.6;
    pointer-events: none;
}

.tbm-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0066cc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Accessibility */
.tbm-add-to-cart-btn:focus,
.tbm-rental-btn:focus,
.tbm-place-order-btn:focus {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

.tbm-quantity-input:focus,
.tbm-cart-quantity:focus {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
    border-color: #0066cc;
}

/* Količinske omejitve */
.tbm-quantity-limits-info {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

.tbm-quantity-limits-info h4 {
    margin: 0 0 10px 0;
    color: #0066cc;
    font-size: 16px;
}

.tbm-limits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.tbm-limit-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 10px;
    transition: all 0.3s ease;
}

.tbm-limit-item.good {
    border-left: 4px solid #28a745;
}

.tbm-limit-item.warning {
    border-left: 4px solid #ffc107;
}

.tbm-limit-item.critical {
    border-left: 4px solid #dc3545;
}

.tbm-limit-name {
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
}

.tbm-limit-progress {
    margin-bottom: 5px;
}

.tbm-progress-bar {
    background: #e9ecef;
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 5px;
}

.tbm-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #ffc107, #dc3545);
    transition: width 0.3s ease;
}

.tbm-limit-text {
    font-size: 12px;
    color: #666;
    text-align: center;
}

.tbm-limit-info {
    margin: 10px 0;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
}

.tbm-limit-info.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.tbm-limit-info.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.tbm-limit-info.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Print styles */
@media print {

    .tbm-action-buttons,
    .tbm-cart-actions,
    .tbm-modal {
        display: none !important;
    }

    .tbm-material-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* Responsive design za omejitve */
@media (max-width: 768px) {
    .tbm-limits-grid {
        grid-template-columns: 1fr;
    }
}

/* Shortcode registration form styling */
.tbm-partner-registration-form {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px;
    background: linear-gradient(135deg, #0080ff 0%, #2d8659 100%);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
}

.tbm-registration-header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.tbm-registration-header h3 {
    color: white;
    margin-bottom: 15px;
    font-size: 2.2rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.tbm-registration-header p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.tbm-partner-registration-form form {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.tbm-partner-registration-form form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #0080ff, #2d8659);
}

.tbm-form-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #f1f3f4;
    position: relative;
}

.tbm-form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
}

.tbm-form-section h4 {
    color: #2d3748;
    margin-bottom: 25px;
    font-size: 1.3rem;
    font-weight: 600;
    position: relative;
    padding-left: 20px;
}

.tbm-form-section h4::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: linear-gradient(135deg, #0080ff, #2d8659);
    border-radius: 2px;
}

.tbm-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 25px;
}

.tbm-form-group {
    margin-bottom: 25px;
    position: relative;
}

.tbm-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2d3748;
    font-size: 0.95rem;
}

.tbm-form-group input,
.tbm-form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #fafafa;
    font-family: inherit;
}

.tbm-form-group input:focus,
.tbm-form-group textarea:focus {
    outline: none;
    border-color: #0066cc;
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
    transform: translateY(-1px);
}

.tbm-field-help {
    color: #718096;
    font-size: 13px;
    margin-top: 6px;
    display: block;
    font-style: italic;
}

.tbm-field-error {
    color: #d63638;
    font-size: 13px;
    margin-top: 8px;
    font-weight: 600;
    display: none;
}

.tbm-field-error:not(:empty) {
    display: block;
    background: #fdf2f2;
    padding: 10px 15px;
    border-radius: 8px;
    border-left: 4px solid #d63638;
    margin-top: 10px;
    box-shadow: 0 4px 6px rgba(214, 54, 56, 0.1);
    animation: tbmShake 0.4s ease-in-out;
    color: #d63638;
    position: relative;
}

.tbm-field-error:not(:empty)::before {
    content: '⚠️';
    margin-right: 8px;
}

@keyframes tbmShake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-4px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(4px);
    }
}

.tbm-input-error {
    border-color: #d63638 !important;
    background-color: #fff8f8 !important;
    box-shadow: 0 0 0 3px rgba(214, 54, 56, 0.1) !important;
}

.tbm-checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    margin-bottom: 0;
    padding: 15px;
    background: #f7fafc;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.tbm-checkbox-label:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.tbm-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 12px;
    margin-top: 2px;
    accent-color: #0066cc;
}

.tbm-checkbox-text {
    line-height: 1.5;
    color: #2d3748;
    font-weight: 500;
}

.required {
    color: #e53e3e;
    font-weight: bold;
}

.tbm-form-actions {
    text-align: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #f1f3f4;
}

.tbm-submit-btn {
    background: linear-gradient(135deg, #0080ff 0%, #2d8659 100%);
    color: white;
    border: none;
    padding: 18px 40px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
}

.tbm-submit-btn::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;
}

.tbm-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.tbm-submit-btn:hover:not(:disabled)::before {
    left: 100%;
}

.tbm-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.tbm-success-message {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 1px solid #c3e6cb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    color: #155724;
    font-weight: 600;
    text-align: center;
    border-left: 4px solid #28a745;
    animation: slideIn 0.3s ease-out;
}

/* Napake validacije – rdeče, vidne */
.tbm-field-error {
    color: #b91c1c;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 6px;
    min-height: 1.4em;
    line-height: 1.4;
}

.tbm-registration-form .tbm-field-error,
.tbm-auth-pane .tbm-field-error {
    color: #b91c1c;
}

/* Obvestila (splošna napaka / uspeh) */
.tbm-notice {
    padding: 14px 18px;
    margin-bottom: 20px;
    border-radius: 8px;
    border-left: 4px solid;
    font-weight: 600;
    font-size: 0.95rem;
}

.tbm-notice-error {
    background-color: #fef2f2;
    border-left-color: #b91c1c;
    color: #991b1b;
}

.tbm-registration-form .tbm-notice-error,
.tbm-auth-pane .tbm-notice-error {
    background-color: #fef2f2;
    border-left-color: #b91c1c;
    color: #991b1b;
}

.tbm-notice-success {
    background-color: #f0fdf4;
    border-left-color: #16a34a;
    color: #166534;
}

.tbm-registration-info {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 25px;
    margin-top: 40px;
    position: relative;
}

.tbm-registration-info::before {
    content: 'ℹ️';
    position: absolute;
    top: -15px;
    left: 25px;
    background: white;
    padding: 8px 12px;
    border-radius: 50%;
    font-size: 18px;
    border: 2px solid #e2e8f0;
}

.tbm-registration-info h4 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: 600;
}

.tbm-registration-info ul {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.tbm-registration-info li {
    margin-bottom: 12px;
    color: #4a5568;
    padding-left: 25px;
    position: relative;
    line-height: 1.6;
}

.tbm-registration-info li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #48bb78;
    font-weight: bold;
    font-size: 16px;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive design for shortcode form */
@media (max-width: 768px) {
    .tbm-partner-registration-form {
        padding: 15px;
    }

    .tbm-partner-registration-form form {
        padding: 25px;
        border-radius: 12px;
    }

    .tbm-form-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .tbm-registration-header h3 {
        font-size: 1.8rem;
    }

    .tbm-registration-header p {
        font-size: 1rem;
    }

    .tbm-submit-btn {
        width: 100%;
        padding: 16px 30px;
    }
}

@media (max-width: 480px) {
    .tbm-partner-registration-form {
        padding: 10px;
    }

    .tbm-partner-registration-form form {
        padding: 20px;
        margin: 5px;
    }

    .tbm-registration-header h3 {
        font-size: 1.6rem;
    }

    .tbm-form-section h4 {
        font-size: 1.1rem;
    }
}

/* My Account Address Styling */
.woocommerce-Address-title h3 {
    display: inline-block;
}

/* Hide shipping address specifically if still showing */
.u-column2.woocommerce-Address,
.u-column2.col-2.address {
    display: none !important;
}

/* Force address container to full width after hiding shipping */
.u-column1.woocommerce-Address,
.u-column1.col-1.address {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
}